Google Tag Manager Tracking

Melody Jaimon • January 9, 2023

This article will show you how to integrate Google Tag Manager into your website.


This article does not exactly follow Google's instructions, but it has been tested and works properly. The instructions differ from those provided by Google for the following reasons:


  1. Google requests that you place the code in the site's <head>. This is bad practice for page speed because it slows down the site's loading. As a result, we place it at the bottom of the <body-end> so that it loads last.
  2. It is more convenient to copy code into a single location.

Add Google Tag Manager

Google will provide you with code embeds that resemble the examples below. Both of these must be installed in the site's body-end. To find the site's body-end>, open the editor's side panel and navigate to Settings, then Head HTML.


The code below is just an example; do not paste it into your site. Please ensure that you obtain the correct Google code.

Set Up Google Tag Manager

This step is critical for enabling Google Tag Manager tracking on your website.


The default All Pages page view trigger must then be replaced with our custom event. We must first create the custom event trigger within the tag manager:


  1. Sign in to Google Tag Manager.
  2. Click Triggers on the left.
  3. Click the new button on the right side.
  4. At the top left, give the trigger a name. Something memorable and useful, such as Custom Page View Trigger, is recommended.
  5. Select Custom Event from the custom trigger configuration box.

   6.  Enter dPageView in the event name box.

   7.  In Tag Manager, click the Save button.

After creating the trigger, we must apply it to the desired tags. This must be done for each tag used on the site to trigger page view events. In this case, we'll use Google Analytics Universal.

  1. Navigate to tags in Tag Manager.
  2. Make a new tag.
  3. Make your name memorable.
  4. Select the tag you want to use by clicking the Tag Configuration box. Google Analytics Universal in this case.
  5. After you've finished configuring the tag, check the Triggering box. Select the Custom Page View Trigger that we created.

If the All Pages trigger is already active, please remove it. The only thing we need is for the custom trigger to fire.


  6.  Choose a new variable.

  7.  Navigate to Google Analytics Settings.

  8.  At the top, enter your GA tracking ID and a name for your variable.

  9.  Select the variable and press the Save button.


After you've made these changes to Tag Manager, click Submit and then Publish to make the changes live.

Considerations for Google Tag Manager

  • This code will only be executed on the live published website. Make certain that you test it on the live version.
  • We have completed extensive testing, and the body-end.html section of Developer Mode is functional for adding noscript and default code.
  • Changes to the 'dataLayer' setting in Google Tag Manager will break our custom integration code.

See How Our Agency Can Drive Massive Amounts of Traffic to Your Website

Website Design designed for your audience and to be found on Google Searches
SEO - unlock relevant and increased SEO traffic. 

Paid Media - effective paid strategies with a clear ROI.

Get Started

Love My Online Marketing has 10+ Years of working alongside businesses and helping them grow. Discuss your options for online success from website Design and Development through to Google Marketing.

Get in Touch

Do you want more traffic and business leads?

Love My Online Marketing is determined to make a business grow. Our only question is, will it be yours?

Let's Chat
A man is typing on a laptop computer on a wooden table.
By Melody Jaimon June 6, 2025
Many overlook the footer, but in 2025 it’s a strategic asset. Explore footer design ideas that can enhance your website’s performance. Read the full blog.
A man is typing on a keyboard while another man points at a computer screen.
June 2, 2025
Discover the 2025 software development process from a marketer’s perspective. Learn how modern dev cycles, agile methods, and cross-functional collaboration impact marketing success.
A person is using a cell phone in front of a laptop.
By Melody Jaimon May 26, 2025
Microsoft Teams Not Syncing on Mobile? Here's the Real Fix (2025 Guide) If your Microsoft Teams app isn't syncing on your iPhone or Android, you're not alone — and no, it's not just a glitch. This quick, step-by-step guide shows you how to fix Teams not syncing on mobile in under 2 minutes. No tech jargon, no guesswork — just the actual solution that works in 2025. Perfect for remote teams, business owners, and anyone who relies on Teams for work. 👉 Click here for the fix that actually works
A laptop computer is open to a website on a wooden table.
By Melody Jaimon May 23, 2025
Over 58% of Google searches end without a click. Find out how zero-click searches impact website traffic and what marketers can do to stay visible.
A woman is sitting at a table using a laptop computer.
By Melody Jaimon May 15, 2025
SEO pricing in Australia ranges widely in 2025. Learn what impacts cost, what to avoid, and how Love My Online Marketing structures SEO for ROI. Read more.
A person is holding a cell phone in their hand with social media icons coming out of it.
By Melody Jaimon May 15, 2025
This strategic 9-post monthly plan helps you stay consistent on social media, boost engagement, and simplify your content creation. Read the full guide.
Google Business Profile zoomed in by magnifying glass
By Melody Jaimon May 14, 2025
Learn how to add a digital marketing agency to Google Business Profile in this quick step-by-step guide with photos.
A woman is sitting at a desk using a laptop computer.
By Melody Jaimon May 13, 2025
Worried about YouTube suspension? Learn the top causes and how to avoid them to keep your channel safe, secure, and thriving. Read the full guide now.
A man is using a smart phone with social media icons coming out of it.
By Melody Jaimon May 12, 2025
Launched your site? Learn practical ways to promote your new website design on social media using creative, engaging post ideas that boost visibility and drive traffic. Read the full guide now.
A notebook with the words call to action written on it
By Melody Jaimon April 8, 2025
Effective CTAs guide users through your site and drive action. Learn best practices for creating clear, visible, and persuasive CTAs that actually convert.
More Posts