Analytics or JavaScript Code insertion help

Posted in: Newspaper
Post count: 32

Hi,
just getting confused, so willing to know:

In Analytics and/or JavaScript Code the “?” shows that The Analytics code must have this form:

<script>
(function(i,s,o,g,r,a,m)
{i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new 
Date();a=s.createElement(o),m=s.getElementsByTagName(o)
[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','
https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-XXXXX-Y', 'auto');
ga('send', 'pageview');
</script>

But from Google Analytics portal the tracking code is as follows:

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

So, which Code format i should paste inside the box ? The official format, or the “?” button specified format ?
Thank you.

Post count: 205

@IamBidyuT
Use the second one

Post count: 32

@Viju
You mean TagDiv’s “?” given format ?

Post count: 205

Provided by Google will work best

Post count: 205

Provided by Google is a new generation code.

Post count: 32

@Viju
Thanks for taking time & suggestion 🙂

Post count: 32

Where did you end up putting the two pieces of code for GTM.

When I use the Theme panel to place the code, I’m getting this: Non-standard implementation in Google Tag assistant.

It still seems to fire, but the page is kicking back when using AdRotate.

suggestions?

Best
Mike

Viewing 7 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic.