Hey there, I'm Benjamin from Loves Data. Welcome
to the fourth lesson in my Google Tag Manager training series! In this lesson,
you will learn about migrating and deploying Google Tag Manager on your website. We will
run through my checklist to ensure everything is ready before you publish your container.
In previous lessons we've covered the steps to get started, adding and testing tags. I've included
links to the other lessons in the description below this video. Okay, it's time to get started!
The steps you'll need to take to migrate your implementation to Google Tag Manager
will depend on the tags you currently have on your website. For example, if you're only using
the Google Analytics tag and you haven't made any customizations to the data that it collects,
then migration will be fairly straightforward. However, if you have added customizations to
the Google Analytics tag and have other tags on your website, then you will need to take time
planning your migration. Let's walk through some of the different scenarios you might encounter...
The simplest scenario is if you're just getting started. For example, if you're launching an
entirely new website and you don't have an existing Google Analytics property. In this case,
you can set everything up from scratch in Google Tag Manager. You will create your property,
get your measurement or tracking ID from Google Analytics and configure your tags in Google Tag
Manager. Then there is the scenario of just having the standard Google Analytics tag added to your
website. You might be using a plugin or maybe you've added the gtag.js tag to your website.
But you're just using the standard tag and you haven't made any customizations to your tracking.
In this case, you can add the Google Tag Manager code in parallel to the existing tag. Replicate
the tag in Google Tag Manager, then publish your container and remove the existing tag.
The next scenario is if you're using a modified Google Analytics tag,
or you've implemented customizations. For example, if you've added the gtag.js tag to your website,
and you've configured ecommerce tracking. In this case, you will need to replicate the
Google Analytics tag in Google Tag Manager, and you will also need to ensure Google Tag Manager
is configured to capture your ecommerce transaction details and pass them to Google
Analytics. And continuing this scenario, you might have implemented additional customizations,
like user properties for GA4, or cross-domain tracking for Universal Analytics.
You will need to take extra time to ensure that these customizations are implemented
using Google Tag Manager before you remove any existing tags from your website. And apart from
Google Analytics, you will also need to look for any other tags, and any other third-party
code you've added to your website. In most cases, these can also be migrated to Google Tag Manager.
Okay, now let's run through my migration checklist. Depending on the current tags
that have been added to your website, you can customize this checklist. And if you would like
to download a copy of my Google Tag Manager Guide that includes this checklist, then you can find
a link to get the guide in the description below this video. Step one is to create a list of your
existing tags. This should include your Google Analytics tags, and any other tags you've added
to your website. It's also a good idea to make a note of how the tags are added to your website.
For example, you might be using a plugin to add the Google Analytics tag to your website
and maybe you've added the Facebook pixel by pasting it into your website's template.
Step two is to create a list of any tracking customizations you've made. For example, you might
have implemented ecommerce tracking to record the items people purchase on your website. Or
if you're using Universal Analytics you might have added event tracking to report how many people are
downloading a particular PDF on your website. Step three is to document your current implementation.
It can be helpful to create a spreadsheet that contains all of the tags and customizations.
This spreadsheet documents different tags currently used on a website,
so you can then have a full view of all of the elements you need to implement
in Google Tag Manager. Creating a spreadsheet like this is optional, but it's definitely useful if
you have multiple tags and customizations you need to migrate to your container.
Step four is to add the Google Tag Manager container code to all of the pages of your
website. The way you add the container code will depend on the website platform you're using. For
example, if you're using Wordpress, then you might use a plugin to add the code to all of your pages.
Or if you're using Squarespace, you will use the 'Code Injection' option to add the code.
In the first lesson, we walked through adding the container code to our website. So feel free to
rewatch the first lesson if needed. I've included a link in the description below this video.
Step five is optional, but if you are using a brand new Google Tag Manager container that has
never been published, then you can publish the empty container before adding tags.
We saw this in the previous lesson. Basically, if you've never published the container the preview
mode won't work. Step six is also optional... It's to work with your web developer to add a custom
data layer to your website. A custom data layer makes information available to Google Tag Manager.
For example, if you're using an ecommerce platform that doesn't provide a Google Tag Manager
integration, then you will want to implement a custom data layer that includes transaction
details. This means that when a transaction occurs you can pass all of the transaction details to
Google Analytics, Google Ads, Facebook, and any other tags where you want to send ecommerce data.
Step seven is to check that variables have been enabled (or created) for any information you want
to use in your tags and triggers. For example, if you want to track people clicking on a particular
website promotion, you might need to enable the 'Click Class' or 'Click ID' variable,
so you can make use of the class or ID of the element someone clicks on your website.
Step eight is to create all of your tags in Google Tag Manager. This is where you take all of your
notes from steps one, two, and three and add all of the tags you're using to your container.
Step nine is to apply appropriate triggers to your tags. For example, when you add the default
pageview tags for Google Analytics you can use the built-in 'All Pages' trigger. This will mean the
tag is added to every page of your website. Then for any tags that need to fire on individual pages
or for specific actions, you will need to create custom triggers in Google Tag Manager.
Triggers can be created based on a whole range of actions, from the page someone is viewing,
to the element they click, to watching an embedded YouTube video. There's a whole range
of triggers. If you'd like to learn more about the different types of triggers you can create,
check out the extra resources in the description below this video. I've included a link to my
Google Tag Manager Glossary. Step ten is to test all of your tags using the preview mode.
We covered Tag Assistant and the preview mode in the previous lesson.
If you missed it, then I've included a link in the description below this video.
Finally, step eleven... Once you're happy with the tags triggers and variables you've added to Google
Tag Manager, it's time to publish your container. The important thing to remember is that when you
publish your container, you should remove any tags that are still hardcoded on your website.
For example, if you've added the Google Tag Manager container code to your website
AND you also have the Google Analytics tag on your website, then when you publish the container,
you should remove the Google Analytics tag. This is because you will now have
the tag in Google Tag Manager and you don't want it to be duplicated on your website.
So they're the steps you need to follow to migrate to Google Tag Manager. Then whenever you need to
add a new tag or modify an existing tag, you can make the changes in Google Tag Manager without
having to change the code on your website. And when you do make changes, don't forget to preview
and test your changes before they're published. If you'd like to continue learning about Google
Tag Manager, then please subscribe to my channel (if you haven't already). In the next lesson,
we will cover conversion tracking using Google Tag Manager. I'll see you in the next video!