Setup Your Free Google Tag Manager Account

Disclosure: Please note that this article may contain affiliate links. You can read the full disclosure here.

To setup your free Google Tag Manager Account, go to

Sign up with your Gmail or Google account email address, I used the same email as I use for Google Analytics.

The main reason we setup Google Tag Manager was to have control over when cookies would fire on our website so that visitors have an option to disable the cookies for GDPR compliance.

So we run the following through Google Tag Manager.

– Google Analytics
— Added Scroll event
— Added Custom Dimension Document Referrer (What is Document Referrer (Google Analytics))

– Facebook Pixel Setup (Ultimate Guide to Setup Facebook Pixel with Google Tag Manager)
– Added our own custom checkbox to our comments section for GDPR compliance.

There is so much more you can do with Google Tag Manager it is a full featured enterprise product and available to us for free.

You will be prompted to add the Google Tag Manager code to your WordPress Header File. We will do this in a later step. For now you can close out of the window if it pops up.

Quick Definitions

Tags – are the equivalent of the HTML <tag> that are used for building the webpage. They are like little scripts of code that run when Triggered.

Triggers – This is an action that the visitor does that causes the tag to run or fire. Example a pageview is one type of trigger. Or clicking on a specific button on the page.

Variables – These are values that you set under variables for things like your domain name, your Facebook Pixel number, your Google Analytics ID etc, specific to your site.

Getting Started: Setup the Variables

First you will need to setup your Variables.

Click on Variables on the Menu on the Left side.

Screenshot of Left side menu

Then scroll down to User defined Variables and click the New button.

Screenshot of New Button

Click on the lego looking icon on the center of the screen.

Screenshot of Lego looking icon

Scroll down through the options till you get to Utilities Then Constant

Screenshot of the Constant Option

Name the constant Domain, and enter your domain name in the field provided.

Screenshot of the Domain variable screen

Add a second Constant variable.

Name: Google Analytics – Tracking ID

Screenshot of Google Analytics Tracking Variable

For the next variable, select Google Analytics Settings, rather than constant.

Screenshot of Google Analytics Settings variable

On the next screen, click the lego icon beside the Tracking ID.

Screenshot of Google Analytics Settings

Select the Google Analytics – Tracking ID variable we setup in the last step.

Screenshot of Google Analytics Tracking ID

Keep the cookie domain as auto

Expand More Settings and Fields to Set

Start Typing AnonomizeIP in the first field and select the option when it appears.

Set the value to true

and click Save.

Screenshot of anonomize IP

Setup the Triggers

Click on Triggers on the Menu on the Left side.

Screenshot of Triggers on the menu

Since we are just doing a very basic setup with Google Analytics only, we will only need one Trigger, which will be a Page View

Click on New

Name your Trigger something like Page View or All Page Views

Click the double circle icon in the middle of the screen.

Select the first option Page View

Screenshot of setting up basic Page View Trigger

Keep the default setting of All Page Views and click save.

Screenshot of PageView Trigger Save

Setup the Tags

Click on Tags on the Menu on the Left side.

Screenshot of Tags on the menu

Click on the New Tag button.

Give your tag a name like Google Analytics.

Click the tag icon on the middle of the screen and select the first option for Universal Google Analytics.

Click the drop-down for Google Analytics Settings and select the Google Analytics Settings variable.

Screenshot of setting up the Google Analytics Tag

Scroll down to the Triggering and click the double circles icon. Select the Page View trigger we just setup for all Page Views.

Click Save.

Screenshot of Tag including Trigger

Install the Google Tag Manager Code

Since you will be using Google Tag Manager to manage your Google Analytics settings you will need to remove any previous Google Analytics settings or plugins so that you do not double up on your Google Analytics tracking. See this link for more details on removing any existing code and Confirming Google Analytics is installed.

On the top of the page, you will see GTM-XXXXXXX beside the Preview and Submit Buttons. Click on the GTM-XXXXXXX and the code you need to install will pop up, you will need to add this to your theme header file or to a Header/Footer Plugin.

Screenshot of GTM code to install

See this post for instructions on adding code to your Theme header file here. This includes instruction on multiple methods.


Once the code is installed on your site, you will want to click the Preview Button.

Screenshot of Preview Submit Buttons

Then open your website in a new tab on the same browser.

You will see the Google Tag Manager details popup on the bottom of your site to show that it is working and you should see the tag fire for a Page View from you opening the page.

If that is working as expected, go back to Google Tag Manager and Click the link Leave Preview Mode and click Ok to leave the preview mode.

Screenshot of Preview Mode and Leave Preview Mode

Submit Changes in Google Tag Manager

Now you will need to submit the changes so that your Google Tag Manager changes Go Live on your site.

Screenshot of Preview Submit Buttons

Click the Submit Button, give the version a name like Setting up Google Analytics, click the Publish button.

Screenshot of Publishing GTM changes

Once you have published your changes you are done.

Please let me know if you run into any trouble or have any questions in the comments below.

Avatar for Tara, WP Blogger Assist

I have over 15 years experience in IT. Over this time: managing server infrastructure, building websites and more. This website is dedicated to helping WordPress bloggers with setting up their blogs and websites; optimizing fast page loading, SEO and social media marketing - such as; Pinterest, Facebook and more.

Leave a Comment