AMP Analytics Code

Posted in: Newspaper
Post count: 14

Dear sirs,

I have such Google Analytics code:

<!– Global site tag (gtag.js) – Google Analytics –>
<script async src=”https://www.googletagmanager.com/gtag/js?id=UA-24265XXX-XX”></script&gt;
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());

gtag(‘config’, ‘UA-24265XXX-XX’);
</script>

Can I paste it to “AMP Analytics”? Will it work? If no, where can I take the other GA code?

Thank you in advance!

Post count: 18283

Hello !

The code must be inserted here: https://www.screencast.com/t/ZfSALunV8Ax First tab is for header codes, second one is for body codes.

Thank you !

Post count: 14

I know where to insert the code.

Please, read my question and answer it. I didn’t ask where to insert the code. I meant if my code is ok.

You wrote: “The analytics json configuration code has to be of this form: …” (https://tagdiv.com/amp-newspaper-theme/).

And I don’t know where to get this “analytics json configuration code of this form”.

Please, read my questions above.

Thank you in advance.

Post count: 18283

Hello !

It may be that our documentation to be a bit outdated since the codes change pretty often. In order to receive the proper code the best way would be to follow googles guide. If their code is not like in our example that is not necessarily wrong.

Thank you !

Post count: 14

Hello! I don’t understand. Can I use the same GA code that I used for the desktop website? Or should I take some special GA code?

Post count: 18283

Hello !

From what I have seen your code is correct. You won’t be needing another code. Everything should work smoothly.

Thank you !

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.