Google analytics code is visible on mobile version

The google analytics url is at the top of every page on the mobile version. Why is it showing up on smartphones at the top?

http://solaflowerfloristry.com

Hey @visinno,

It’s not only showing on mobile but also in desktop (see Secure Note). How did you add your analytics code? Try using the Google Analytics extension.

Thanks.

I used the Google Analytics extension. Please look at how I did it.

Hello There,

Sorry for the confusion. Please be advised that there is a bug in our Google Analytics plugin which is have yet to release an update for that. For the meantime, I went ahead and resolve your issue. I deactivated the Google Analytics plugin and installed “Insert Headers and Footers” plugin instead. I have cleared your plugin cache and you are all set.

Please check your site now.

I still see the code at the top on both phone and computer.
Thanks,
Krina

Hey There,

That is because of your GA code:

<!-- Global site tag (gtag.js) - Google Analytics -->
https://www.googletagmanager.com/gtag/js?id=UA-118062229-1 
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-118062229-1');
</script>

I am guessing that this is not the correct one. The url https://www.googletagmanager.com/gtag/js?id=UA-118062229-1 is not supposed to be in that code. Could you please double check if you get the correct code from your Google Analytics dashboard.

Please let us know how it goes.

The tracking code you’ve inserted is incomplete, @visinno. The first line of the code, which is a JavaScript link, is supposed to be enclosed in -script- tags.

This is what the code should look lke:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-118062229-1"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('configUA-84667249-19-1');
</script>

Pasting in the correct version of the tracking code will resolve the issue.

@thompsonpaul

Thanks for helping out. Have a nice day!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.