Crown Street, Wollongong, 2500

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. Book a Free 20min Discovery Call.

Book A Discovery Call

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
Leave a review card
By Melody Jaimon February 5, 2025
Google Business Profile reviews can be one of your most successful digital marketing tactics, and the best part is that it's free! Whether you run a small local business or a large enterprise, having a steady stream of positive reviews can significantly impact your online presence and customer trust. 
A book titled brand identity sits on a desk next to a keyboard
By Melody Jaimon January 21, 2025
Branding has evolved from ancient symbols to modern strategies shaping businesses. Explore its history, milestones, and future innovations. Read more now!
A smiling woman in glasses working on a laptop in a bright office.
By Melody Jaimon December 17, 2024
Learn how to streamline your marketing efforts with our guide to setting up an effective direct mail campaign. Discover tips for targeting your audience, crafting compelling messages, and boosting response rates for maximum impact.
woman browsing using her phone
By Melody Jaimon November 25, 2024
In this article, we highlight the importance of technologies that help iPhone users tackle cyber threats and have a safe browsing experience.
Laptop displaying LinkedIn logo and tagline on blue screen, with plant in the background.
By Melody Jaimon November 5, 2024
Learn how to add admins to your LinkedIn Page in this step-by-step guide. Boost engagement, improve page management, and expand team collaboration on LinkedIn with ease!
collaboration at work
By Melody Jaimon November 3, 2024
Create impactful annual reports for charities and non-profits by focusing on audience needs, maintaining consistency, and paying attention to design elements. Read more here.
a man clicking on domain on an augmented reality UI
By Melody Jaimon October 29, 2024
Have you been given access to your domain by your agency? Learn how to manage your domain access in this blog post.
black-themed website
By Melody Jaimon October 16, 2024
Learn the pros, cons, and latest trends in black website design. Find out how this bold aesthetic impacts user experience, branding, and site performance. Read more here.
seo concepts on paper
By Melody Jaimon October 11, 2024
Protect your website from Google algorithm updates with white hat SEO techniques. Learn strategies to enhance your organic rankings while adhering to Google's best practices.
woman using a laptop and writing an e-mail
By Melody Jaimon October 1, 2024
This guide will teach you step by step how to set up an email marketing campaign with MailChimp. Learn to use this powerful tool!
More Posts
Share by: