Switch from Google Analytics to Tag Manager - google-analytics

I have site which run on Google Analytics for some time( more than 1 year), now I want to use Google Tag Manager. If i remove Google Analytics from site, and start tracking with tag manager, there is a risk of losing data?

It's really hard to give a helpful answer to that - if you manage a seamless switch between GTM and inline GA code, and have set up everything correctly then you will not lose data. Is there a risk you make mistakes ? Probably.
I recommend to integrate GTM alongside GA and set up your GA tags so that they track to a test property. Then you can compare both properties to make sure that you track actually the same things. And that point you can throw out the inline GA code and switch to GTM (if you implement the tracking id as a variable in GTM it will be as simple as changing a single variable).
But remember to actually remove the inline code, else you will end up with double pageviews.

Related

Adding GTM to a website with GA

I have a website that has been using GA for some time. Now someone wants me to add it to theirs GTM and replace my snippet with that GTM tag.
I don't know how to use GTM and don't really want to dig into that :/
My website was working just fine... Is there some easy way to make GTM just a simple middle man that looks at my domain and just throw everything directly to GA?
I manage to make it so GA gets info on the website traffic like active users etc. however that website has scripts that fires events to GA.
After googling a while i think this is because GTM adds some random names to the trackers and my code calls ga('send', ... ) directly :/
I know i can make a custom tag in GTM but they want it to be UA tag -_-.
Is there any way to set a default name for my trigger in GTM settings? Or some other solution?
atm. i have a code with gtm tag only and I'd rather avoid changing my web code if possible.
Edit
Ok, could someone explain to me how to achieve this:
I have this code:
var a = $('meta[property="a"]').attr('content');
var b = $('meta[property="b"]').attr('content');
ga('send','event',a,event,b);
where event is one of several possible strings of for example 'event_1','event_2' or'event_3'
and my GA has 3 goals that have action = 'event_1' etc.
How do i replace this with GTM and dataLayer?
This thread has 2 questions :
1.- Migrate a hardcode implementation of Google Universal into Tag Manager is not so simple as copy and replace the Universal Main Snipper for the GTM Code.
Look for this google guide to migrate. Has more or less the steps needed and the one to take in consideration during the migration.
https://developers.google.com/tag-manager/devguide#migration
If you goes for GTM, it's higly recomended to remove your ga() function on the page, this will stop working and you javascript too. Basically this mean, remove all your Google Analytics of the domains and install GTM and configure the corrects tags. Try to avoid things like paste the Google Analytics code inside a custom HTML tag, it's a very bad practice, but is see that a lot. Plan your migration
2.- Regarding the event you have to do :
Create a tag of universal analytics events and activate when you pushes a GTM event, them manage this values via the dataLayer
Let this link for more information:
https://support.google.com/analytics/answer/6164470?hl=en
var a = $('meta[property="a"]').attr('content');
var b = $('meta[property="b"]').attr('content');
dataLayer.push({'event': 'ga_event' , 'cat' : a , 'act' : b})
Try to involve more yourself in the GTM and Universal's World before ask, i'm not trying to be an asshole, but this question involves so many things that can be solved just looking the documentation, and somany thing to examplain in a single post.

Google Analytics with GTM; is it possible that data will be duplicated?

I'm fairly new to Google Tag Manager, in the past I've just fired events straight to Google Analytics. What I'm wondering is this; is it possible that, if you use Google Analytics alongside Google Analytics tags in GTM, can you get duplicate data in Google Analytics?
For instance, let's say I have a Pageview tag in GTM, as well as GA on the webpage as normal. Would this count as two pageviews? (ie. one from standard GA, one from the GTM tag)
I've looked around for an answer, but maybe it's just a stupid question!
If both track to the same property you'd get two pageviews in that Ga property.
However there is a good chance that both pageviews would end up in different sessions; GTM creates a random name for the Google Analytics tracker, while the tracker within the page would track to the standard tracker (t0; read about naming trackers here), unless configured otherwise.
IMO it is not a good idea to mix GTM and inline trackers with the same property, since it's hard to be sure that both use the same configuration. And yes, your pageview will be counted twice.

Switch to Tag Manager, will Enhanced Ecommerce still work?

I've successfully implemented Google Enhanced Ecommerce on one of my websites, where I also have a Google Universal Analytics tracking code. Now we want to change to Google Tag Manager, thus replacing the UA tracking code with the Tag Manager Code (correct?)
Will this affect the Enhanced Ecommerce tracking in any way? Or can I just replace the tracking snippet and the ga('create')-parts with the Tag Manager-snippet?
You need a correctly set up dataLayer (which rather more complicated since you need info on product impressions etc). Documentation is here:
https://developers.google.com/tag-manager/enhanced-ecommerce#enable
Then you create a news Analytics Tag (just a pageview or event, there is no need for a separate transaction tag) and select "Enhanced Ecommerce" with the "Use datalayer" option in the advanced settings.
GTM will pick up the values from there datalayer and do the rest for you.
So yes, you can get this to work, but it requires a lot of preparation for the correct datalayer implementation. Simply replacing the GA code with the GTM code will do very little except breaking your tracking.

Should I remove GA/GDN code if I'm using GTM?

Does GTM code + GA/GDN Tag is enough to track my website analytics ? should I remove GA code if I'm using GTM ?
And aboud google adwords goals , should I remove Google adwords code too and use that one provided from GTM ?
Does GTM code + GA/GDN Tag is enough to track my website analytics ?
Yes, if you have configured the GA tracking tag in the tag manager you do not any other GA code on your site.
should I remove GA code if I'm using GTM
Yes. You do not need it anymore and if you do not remove it you might track your pages and event twice.
And aboud google adwords goals , should I remove Google adwords code
too and use that one provided from GTM
While it is still possible to use the Adwords code side by side with the tag manager it does not make any sense. As a matter of elegance and maintainability I'd say YES, you should remove page code and use GTM instead. Having all tags in one location is after all the point of GTM.

Google Tag Manager + Google Analytics v just using GA: any reason to use just GA?

I am using Google Tag Manager on all my sites now to implement Google Analytics and future proof them for any other scripts.
I am putting GTM in my boilerplate.
Is there any reason this might not be good practice?
Any reason why a website (that needs GA) should avoid Google Tag Manager?
Most websites will require some sort of Javascript code added in the future for affiliate tracking, various analytics and having GTM installed will allow for easy installation of any such JS code easily.
Or, as Google puts it: "Why wait months for site code updates? Google Tag Manager lets you launch new tags any time with a few clicks, so you never miss a measurement or marketing opportunity."
Since GTM does not come with a service level agreement you could (very very tenuously) argue that GTM adds an additional point of failure. And if one wanted to be pedantic one could point out that not all ways of analytics tracking work with GTM (if you track serverside via the measurement protocol).
But real life argument, there is none (IMO).
There might be pages that do not greatly profit from GTM (or any other Tag Management) if all you do is to deploy a single analytics tag to track pageviews. But the second you need to track an event or pass data GTM is already worth it.
This is not meant to be merely opinion based, it's more that in 2,5 years of using GTM on large sites I have been unable to find any scenario where the tag management code has caused any technical problem or interfered with existing code. On the other hand I do not write click handlers or submit handlers anymore, I have a boilerplate template for a container tag in which I just have to replace values for a few macros before I import it to GTM and have tracking up and running, I can set data fields with much less trouble than via the code... so I think there is a real technical argument to make in favour of GTM, and none against it.

Resources