Before we talk about Google Tag Manager migration, lets discuss some of the features that Google Tag Manager has and how that makes a difference.
What is Google Tag Manager?
It is a tag management system that allows you to easily manage and update tags on your website and mobile apps. Tag Manager makes it so easy that you can control third party custom tags without asking for help from a developer. An Intro to Google Tag Manager will give you an overview about the basics of GTM and why you should use it.
Â
Why Google Tag Manager Migration?
Google tag manager makes a whole lot of things easier when you use it with Google Analytics. There are several benefits of having Google Tag Manager migration, of which some are given below:
-
It enables you to track everything that you care about on your site.
-
Tag Manager allows event tracking on your site, such as, form submissions, page scroll, outbound links and clicks.
-
Instead of adding code snippets to your site manually you would be using a single tag which will trigger at specific events your set
Migrating From Google Analytics to Tag Manager
While Google Tag Manager migration you have to be careful so as to not lose your data or mess up your setup. The steps that I have laid out below will help you keep your data safe.
Create Code Specs for your Website which should define what code should be removed and added to website.
Â
STEP 0: SITE AND Google Tag Manager AUDIT
Audit site & GA identify items setup:
-
Check what version of google analytics site is using. If GTM and GA both codes are present on site be sure to check the tracking id (UA - ID) being used are different otherwise this will lead to double count in tracking.
-
If GTM is not used :
-
Where is the code that sends in data to google analytics.
-
Is cross domain tracking implemented for sites.
-
what are the potential things that are not currently tracked or what can we do to improve the current tracking setup
-
-
If GTM is used :
-
Are there iframes or sister sites that have different version of analytics setup on them.
-
What are the things that we can track with GTM.
-
Are there any marketing code like adwords and remarketing that can be migrated to GTM.
-
-
List down the things we would need from backend and pushed to dataLayer in order to setup tracking.
-
identify what is setup on the site e.g., tags, marketing (facebook, adwords others), GA
-
identify any items that are getting data from backend e.g., transaction, custom dimension etc
-
Identify logic on when and why data is sent
-
is it sent on pageload on all pages / specific page?
-
sent on a particular action? click / form submit
-
-
Look in page code as well as .js files to identify logic and custom code
Â
Create a checklist of all the Events, Custom Dimensions, Ecommerce Setup, Marketing and other custom code and logic that were active during certain past 6 months in GA. For better understanding and keeping record for setting up GTM later here is sample checklist for events and custom dimensions.
Â
Step 1: Staging / Testing
Staging is a process of defining multiple server environments in tag manager. This is done when you want to test the container changes before google tag manager migration or just setting up GTM. Read more about Environments in google tag manager.
-
Setup GTM on the test site
-
Test GTM codes and tags
-
If everything works fine and receiving data correctly move it to live
Â
STEP 2: REMOVE CODE FROM WEBSITE
-
Default/Customize GA Tracking
-
Other tracking code. (To locate other tracking code search for ga(‘ in website code). Other tracking can include the following:
-
Cross domain tracking
-
Events
-
Custom Dimensions
-
Ecommerce Tracking
-
Marketing Code
-
Third party tracking code
-
-
Use tag assistant to see different google services added to site including GA and Adwords
Â
STEP 3: ADD CODE TO WEBSITE
-
Default GTM Tracking code: Setup new container for the website and and get code from Admin → Container → Install Google Tag Manager. Make sure to add this code in start of body Tag in website HTML to all pages of website.
-
If custom dimensions or any other code were present, (which includes custom data), add dataLayer code to push information included in dimensions on pages from where GA code was removed. Add all dataLayer code before GTM Tracking code in body Tag.
-
Check pageview
Â
STEP 4: SETUP TAGS & Make Sure Tag Manager works
Once the old code is replaced with the new code that includes GTM Tracking code, setup the following tags:
-
Page View Tag (Read from How to Connect Tag Manager to Google Analytics)
-
Events tag, for event code that was removed from GA.
-
Other tags for e.g., marketing, custom tracking and custom dimensions.
-
Recreate other tracking code that were removed from Google Analytics in Tag Manager. Most of the tags (mainly events) can be tracked using GTM default functionality. For others, tracking code and logic implementation use Custom Javascript.
-
Preview GTM, test the different tags in real time and then cross your fingers and hit publish.
Â
STEP 5: Verify your new setup
-
The best way to test GTM data is to create custom property and compare it with original property setup. To ease comparison we can use Google Analytics add on for Google Sheet. From there we can create reports for original and custom property and compare data side-by-side. We can additionally add charts to visually test the data.
-
Metrics that can be compared include Page View, Session, User and Bounce Rate
-
Dimensions include date, hostname etc.
-
Generally we see 0-3% difference in data between GA on the page vs GTM. original metrics so they will not likely match in numbers but will be in similar range., ecommerce data should match exactly.
-
So we have completed the steps for a successful Google Tag Manager migration. I hope you understood the steps clearly and if not please specify in the comment.