Forum Moderators: DixonJones

Message Too Old, No Replies

GA and new added line like Google Tag manager

         

toplisek

9:13 pm on Dec 2, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I have seen new added line inside GA which is used also to integrate Google Tag Manager.

As Google Tag Manager has its own tracking code is this needed to integrate GA and Google Tag Manage or it is not needed as both have other tracking code?

I'm not sure but why is then added line inside GA like <script async src="https://www.googletagmanager.com/gtag/js?id="></script>

Example: We track GA and Google Tag Manager using separate tracking code like suggested but than there is added new line inside GA.

I'm new to this and need help.

ergophobe

1:40 am on Dec 4, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Google recently rolled out an update to their tracking system.

The old script, was the Universal Analytics analytics.js. The new one is the gtag.js script. For the time being at least, they record the same data, though the methods of doing so are different.

In any case, you should not have an *added* line. If you have gtag.js, you should therefore no longer have analytics. js. It's one or the other.

Also, your gtag call doesn't define an account ID, so it isn't sending any data anyway.

I think your best bet is just to start over. Get rid of your Google Analytics tag and implement it anew, using whichever version you prefer, but definitely using only one version or the other, with a proper account ID declared.

See
- "Migrate from analytics.js to gtag.js" - [developers.google.com...]
- "Add gtag.js to your site" - [developers.google.com...]
- "Set up analytics tracking with gtag.js" - [support.google.com...]

toplisek

12:06 pm on Dec 5, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thank you for this information. Strange that it is an article from October and I added new account two days ago with the old code without any marked area for gtag.js

azlinda

3:12 am on Dec 28, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



They tell you to add this new code immediately after the <head> in the site.

Can the code go after this instead: <head>
<meta charset="UTF-8">
CODE HERE

azlinda

10:44 pm on Dec 29, 2017 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I answered my own question. I put the jtag.js farther down in the head section, and it works well.