0,00 USD

No products in the cart.

Wednesday, May 5, 2021
0,00 USD

No products in the cart.

Home » WordPress and Blogging » Let’s Setup Google Tag Manager

Let’s Setup Google Tag Manager

So, Zip set up GA4 for some reason. Since we're talking about analytics, let's go ahead and install Google Tag Manager and set up some pageview tags.

0
(0)

In the last couple of posts, Zip installed Google Analytics with a plugin. However, he then saw this newfangled thing (as there always is) called Google Analytics 4 in his Analytics account. He couldn’t resist; he pushed the button and enabled it.

While he’s at it, he might as well install Google Tag Manager. Quite a long time back, I used Monster Insights’ paid version. It’s a good plugin and easy to configure. Still, I found some things that it would not track. Then I found that I could do those things and more — without paying for an expensive plugin –by using Google Tag Manager.

Yes, it took some additional work setting up all the tags. However, Tag Manager offers much in the way of flexibility if you want to track custom tags. Does Zip need to set that up right now? Probably not. At this point, he’s only interested in tracking page views. Still, let’s get it out of the way and set it up now.

How to Install Google Tag Manager

Note to sloth: remember to disable any tracking codes or analytics plugins you have on your site that might result in double tracking

AND How to Set Up Pageview Tags in Google Tag Manager

Time needed: 30 minutes.

How to Install Google Tag Manager

  1. Go to Google Tag Manager

    You’ll find it at https://tagmanager.google.com/#/home. You’ll need a Google account — but Zip already has Google Analytics, so, of course, he already has this.

  2. Click “Create Account”

    On the Google Tag Manager homepage, you’ll see a button in the upper right-hand corner inviting you to “create an account.” Create an account (of course, if you already have one and need to add a new site, you can create a new “container” in the same account by clicking on the three dots and choosing “Create Container.”

  3. Create an Account

    After you click the button, you’ll see the page where you can create an account. Choose account name (for instance, the name of your company or your blog), enter a name for your container (this will be where all your tags live), and we’re creating a web container, so we’ll choose “Web.” Click “Create” and move on.
    Google Tag Manager Create Account Page How to install Google Tag Manager

  4. Accept the Terms of Service

    You’ll see a popup with the Google Terms of Service agreement. If you accept them, choose “yes” and move on. If no, you can stop right here.

  5. Your Google Tag Manager code, sir or madam!

    You’ll get a popup with your shiny new Google Tag Manager code telling you to install it in the <head> of your website, and another code in the <body> section. If you don’t copy it right away, not to worry: You can always find it by clicking Admin and then “Install Google Tag Manager” from your tag manager account.

    But how to install this?

    Zip needs to put it in the code of his website so it will be enabled on every page. Many themes, particularly premium ones, will have an area specifically for inserting codes like this. But he’s using a free theme right now and it doesn’t seem to offer this.

    That’s OK, we can add this ability. If you install a plugin like Insert Headers and Footers, you can easily insert the tracking scripts.

    After Zip installs the plugin, he can find it under settings and then put the codes in and save.



    Install Google Tag manager using insert headers and footers plugin

  6. Notice Variables, Triggers. and Tags

    You’ll notice in your Tag Manager account three critical things: Tags, Triggers, and Variables.

    A variable is reusable. We’ll be setting up variables here for our Universal Analytics and GA4 codes.

    A trigger “triggers” the tag to fire on a page. For instance, a pageview is one type of trigger and the one we’ll use there.

    A Tag is what fires on the page.

    You can add tags for everything from tracking videos to how far someone scrolls down on a page to e-commerce. But, for today, we’re going to set up pageview tracking.

  7. Add your Universal Analytics tracking ID

    Skip this if you’re only setting up GA4.

    Click on “Variables” on the left side of the screen. On the next page, click “new’ under “user-defined variables.”

    In the pop-up — give your variable a unique name. We’ll call this one “Universal Analytics.” Click on “Choose a Variable Type to Begin Setup,” and choose the “Google Analytics Settings” variable.

    You’ll see a space to insert your analytics tracking ID. This is the one you can find in your Analytics account as described in this post — the one that starts with UA.

    Insert the code and press “Save.” Creating a Google Analytics Variable in Google Tag Manager

  8. Set up an Analytics Tag

    OK, let’s set up a tag to track page views in Universal Analytics

    Click “Tags” on the left of your screen. Click “New,” and give your tag a name that will let you know what it is.

    Click “Choose a tag type to begin setup,” and choose the “Google Analytics: Universal Analytics” option. Under “Google Analytics Settings,” you’ll see a drop-down where you can choose the variable you just created with your tracking code. Choose that.

    Under “Triggering” choose “choose a trigger to make this tag fire. Click that, and choose “All Pages.” It will look something like the picture below. Click “Save.”Universal Analytics Pageview Tag in Google Tag Manager

  9. Set up Google Analytics 4 Pageviews

    Skip this if you’re only using Universal Analytics.

    You set up GA4 pretty much the same way as you do UA. If you look for a variable specific to GA4, you won’t find it. However, you can set one up using the “Constant” variable and entering your GA4 tracking code. Or you can just enter it directly in the box for the tracking code in your tag.

    Set up your tag just as you did with Universal Analytics, except this time choose the Google Analytics: GA4 tag configuration. Choose the pageviews trigger, again, and save.pageview tags in Google Tag Manager

  10. Submit Your New Workspace

    Eventually, Zip will have many more tags here. But, for now, he’s just installing pageview tracking.

    Whenever you make changes to your Google Tag Manager workspace, you need to submit the new changes — otherwise, they won’t reflect on your website. Click the blue “Submit” button in the upper right-hand corner.

    Then, on the next screen, give your version a name and a description and click “Publish.” Remember to do this anytime you come back and add, remove, or revise tags. It will say, “Sing like no one is listening!” and Voila, your container is published!Publishing changes in Google Tag manager

Again, remember to remove any plugins your have on your website that may be installing the same tracking IDs.

Is Your Tag Working?

Go visit your site in a different browser, or from your phone. Go to your Google Analytics page and check both your UA and GA4 stats (or whichever you’re using).

You may not see activity in GA4 right away. If not, check back in 24 hours.

There are a couple of other ways to check if your tags are firing:

Preview Mode:

In Tag Manager, if you click “Preview” — located right next to “Submit” –you can run a test to see if your tags are firing.

Tag Assistant

In Chrome, you can add the Google Tag Assistant extension. It will analyze which tags are firing on any page if you open it. It’s a good tool if you suspect something isn’t working. Go to More Tools>Extensions in Chrome and look for Tag Assitant. You’ll see the happy little tag in your browser, and you can click it if you think something’s amiss.

We’ve learned how to install Google Tag Manager. What’s Next?

Next, we’ll (likely) take a look at setting up Google Search Console. Zip can, then, see how visitors are finding his website. Search Console will also help, in the future, ascertain if there may be errors on his website. Errors that might be affecting his performance in search1.

How many hot cups of coffee does this post or page deserve?

Click on an icon to rate it.

Average rating: 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Care to share?

We are sorry that you found this post to be like a weak cup of decaf.

Let us improve this post!

Tell us how we can improve this post?

References and Footnotes
  1. Though, he wonders, how many people really want to read a blog that’s all sloth. Don’t be discouraged and give up now![]
Cheryl
Cherylhttps://www.caffeinejournal.com
Cheryl is a former Occupational Therapist and WordPress enthusiast who became a writer in some parallel universe and occasionally, but infrequently, publishes things in this one. She writes two blogs (or is it three) which she won't quit because she knows that blogs, in her case, are like a hydra and if she cuts one off two more will take its place. When she's not doing that, she enjoys hiking, cycling, kayaking (formerly fast, now ebike), messing around with Adobe illustrator, making assorted things, meditating (though she wouldn't call that "like," and reading. She normally doesn't speak about herself in the third person, but she sometimes uses "we" in the royal sense while writing this blog. She lives in Poulsbo, WA with her spouse, her youngest adult daughter, a very old mutt, and a Siamese cat.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

You might also like:

Sloth Sets up Google Site Kit

Zip has installed Google Analytics and also configured it via Google Tag Manager. Let's take a look at Google Site Kit, its advantages and disadvantages, and how to install it.

Should a Sloth Consider Enabling Google Analytics 4?

Zip has installed Google Analytics. But what's this? He now sees a banner in his analytics account informing him about a NEW thing called Google Analytics 4. He thought he was done. Oh...you're NEVER done! Should he enable GA4? Here are some thoughts on the matter and how to proceed.
Get Email Updates

Sign up for our email list and get updates of new posts. By default, you'll get a weekly digest of new posts and occasional newsletters. However, you can sign up here instead to customize your preferences.

Share this
Send this to a friend