Categories: Google Analytics

Google Analytics has been around since 2005. Google Tag Manager was introduced in 2012. It provides webmasters and marketers with a way to quickly add, replace and modify code snippets in one place without needing access to the website code each time. So, we need to add the code for Google Analytics to track site visits, but then 4 months later, we want to add code to track the site for Dynamics 365 for Marketing, or ClickDimensions. If Google Tag Manager is being used, we can just add the code in tags there rather than on the website. For argument’s sake, the Google Analytics Series COULD have started with this blog post… but I wanted to give you a few posts first to start getting set up with data. Plus, not everyone actually needs to use it if all they want to ever do is just track site visits and not do anything cool… but who wants that?

To get started, visit and add a new account. Create a container, which you can call whatever you like, and set the target platform as Web. Then click Create.

Just like we did with Google Analytics, we get some code to add for Google Tag Manager. So we (or your webmaster) needs to add this in two places. Likely you have a header file where this can be added, but you will have code to add in the <head> section and code to add right after the opening <body> tag. Although the Google Analytics code you have there isn’t needed, don’t remove it just yet.

Once this has been done click on the Variables link from the left navigation and add a new User-Defined Variable. Pick a variable type of Google Analytics settings.

Now we need to configure the variable by adding in your unique Google Analytics Tracking Id. To get this, go in to the Admin area of Google Analytics, then the Property, then Property Settings. The Tracking Id will be right at the top. Copy the id and paste in to the field on your new variable.

Next, we need to add a new tag which we can do by navigating to the Tag section from the left navigation, or from the top left of the overview dashboard. Select the Tag Type of Google Analytics: Universal Analytics. The Track Type is Pageview. From the Google Analytics settings drop down list, you should see {{Google Analytics ID}}. This is the variable we added above. Select this from the list. In the Triggering section, select All Pages.

Once you’ve saved this tag, you should notice there are some Workspace Changes. Don’t submit them just yet. Instead, click on Preview. This will put your workspace in to a preview mode.

Now simply go and open up a new tab in your browser and open up your website. The bottom half of the side should now show a new panel across it. You need to look at the tags summary and in the tags fired section, make sure your Google Analytics Tracking Code fired. This means everything has been installed correctly, and your site visits will continue to be tracked.

Once you’ve confirmed the tag fired, submit the changes, and add some notes for audit purposes as to what we changed. You should now be able to remove the original Google Analytics tracking code added to your site.

If we need to add new tags, like the Dynamics 365 Marketing App tracking code I mentioned, we can simple add a new Custom HTML Tag and paste in the HTML. The triggering will again be on all pages.

Want to just watch how to do this? Check out the video:

Check out the latest post:
Masking Mode In Microsoft Clarity

This is just 1 of 285 articles. You can browse through all of them by going to the main blog page, or navigate through different categories to find more content you are interested in. You can also subscribe and get new blog posts emailed to you directly.

Leave a Reply

Your email address will not be published. Required fields are marked *