How to set up Google Tag Manager for your news website

If you’ve ever opened the source code of your news website and recoiled in horror at the sheer mess of tracking scripts lurking in the header, you’re not alone. Between Google Analytics, Facebook Pixel, ad tracking, heatmaps, and a dozen other scripts that seemed like a good idea at the time, your site can start to feel more like Frankenstein’s monster than a well-oiled publishing machine.

Enter Google Tag Manager (GTM). It’s the organisational wizard that tidies up all those scripts, making your site faster, more efficient, and easier to manage. Instead of dumping every tracking code directly into your site, you pop them all into GTM, which loads them in a neat and orderly fashion. Less clutter, more control, and—crucially—no more relying on your web developer every time you need to add or change a tag.

Step 1: Setting up Google Tag Manager

1.1 Create a Google Tag Manager account

  • Head over to Google Tag Manager and sign in with your Google account.
  • Click Create Account and enter your company name (this will help if you manage multiple sites).
  • Choose your country and click Continue.
  • For Container Setup, enter your website’s domain (e.g., yournewswebsite.com).
  • Choose Web as the target platform, then hit Create.

You’ll need to agree to Google’s terms (because there’s always a terms-and-conditions moment in life), and then you’ll be given a set of code snippets.

1.2 Install GTM on your news website

  • Copy the first code snippet and paste it immediately after the <head> tag on every page.
  • Copy the second code snippet and place it right after the opening <body> tag.
  • If you use WordPress, you can install a plugin like Insert Headers and Footers to avoid editing theme files directly.
  • If your site is running on a CMS with a custom template, you may need to ask your developer nicely (or bribe them with coffee) to insert the code for you.

At this point, GTM is installed, but it’s just sitting there twiddling its thumbs, waiting for you to add some tags.

Step 2: Adding Google Analytics (GA4) with GTM

Your first mission: moving Google Analytics into GTM so you can say goodbye to manually adding tracking scripts.

2.1 Create a Google Analytics Tag

  • In Google Tag Manager, go to TagsNew.
  • Name your tag something logical (e.g., “GA4 – Page View”).
  • Click Tag Configuration → Select Google Analytics: GA4 Configuration.
  • Enter your Measurement ID (you can find this in your Google Analytics account under Admin → Data Streams).
  • Set Send a Page View Event When This Configuration Loads to true.
  • Under Triggering, select All Pages.
  • Click Save.

2.2 Publish the changes

  • Click Submit in GTM.
  • Give your version a name (e.g., “Added GA4 Tracking”).
  • Click Publish.

Boom. Your GA4 tracking is now running through GTM. One less script clogging up your website!

Step 3: Adding other essential tags

3.1 Facebook Pixel (for those wweet Retargeting Ads)

  • Go to TagsNew.
  • Name it “Facebook Pixel – Page View”.
  • Choose Custom HTML as the tag type.
  • Paste your Facebook Pixel code (you’ll find this in your Meta Business Suite under Events Manager).
  • Under Triggering, select All Pages.
  • Click Save and Submit your changes.

3.2 Ad Tracking (Google Ads, Programmatic, etc.)

Most ad platforms like Google Ads or Outbrain provide their own tracking pixels, which you can add in a similar way using Custom HTML tags. Make sure you use the correct triggers, e.g., firing only on conversion pages if you’re tracking sign-ups.

Step 4: Setting up event tracking without losing your mind

GTM’s magic really kicks in when you start tracking interactions like article downloads, video plays, or newsletter sign-ups—without ever touching your site’s code.

4.1 Tracking button clicks (e.g., “Subscribe” button)

  • Go to TriggersNew.
  • Choose Click – All Elements.
  • Under Trigger Configuration, set it to fire on “Some Clicks” and define the condition (e.g., Click Text equals “Subscribe”).
  • Save the trigger.
  • Now, create a New Tag, select Google Analytics: GA4 Event, and configure it to track the button click event.
  • Under Triggering, select the new “Subscribe” trigger.
  • Save and publish.

Step 5: Testing everything (because it will break at some point)

Before assuming everything is working like a dream, you need to test it. Thankfully, GTM has a built-in debugger.

5.1 Using Preview Mode

  • Click Preview in GTM.
  • Enter your website URL and click Connect.
  • Navigate your site and check if your tags are firing correctly.
  • If something isn’t working, go back to GTM and troubleshoot (often a missing trigger condition is the culprit).

You can also use the Google Tag Assistant Chrome extension for further debugging.

Step 6: Keeping GTM clean and efficient

GTM is great, but if you let it become a dumping ground for random scripts, you’ll end up in the same mess you started with. Some golden rules:

  • Name everything properly. “Tag 1” and “Trigger 2” won’t help you six months down the line.
  • Use folders to keep related tags organised (e.g., “Analytics”, “Ads”, “Social Media Pixels”).
  • Audit your tags regularly to remove anything outdated or redundant.
  • Don’t go wild with third-party scripts. More scripts mean slower load times, even with GTM.

Final thoughts

Google Tag Manager is like the Marie Kondo of tracking—keeping your scripts tidy, your website fast, and your analytics in check. With just a bit of setup, you can streamline your tracking processes and free yourself from endless requests to your web developer.

So, go forth and declutter your site! And if something breaks… well, at least you now know where to start fixing it.

Michael is the founder and CEO of Mocono. He spent a decade as an editorial director for a London magazine publisher and needed a subscriptions and paywall platform that was easy to use and didn't break the bank. Mocono was born.

Leave a Reply