How to Install a Script in Google Tag Manager (GTM) to Fire on All Pages

How to Install a Script in Google Tag Manager (GTM) to Fire on All Pages

How to Install a Tracking Script in Google Tag Manager to Fire on All Pages

If you need to install a tracking script (such as Google Ads, Meta Pixel, LinkedIn Insight Tag, or any custom code) on all pages of your website using Google Tag Manager (GTM), follow the steps below.

Step-by-Step Instructions

  1. Log into Google Tag Manager
    Visit tagmanager.google.com and open the container for your website.

  2. Create a New Tag
    In the left-hand menu, click Tags, then click New.

  3. Configure the Tag

    • Click Tag Configuration.

    • Select Custom HTML as the tag type.

  4. Paste Your Tracking Script
    Copy and paste the entire tracking script into the provided HTML field.

  5. Add a Trigger for All Pages

    • Click Triggering.

    • Select All Pages (under the built-in Page View triggers).

  6. Optional: Support Document Write
    If your script requires document.write, check the box labeled Support document.write (use with caution).

  7. Save the Tag
    Give your tag a descriptive name, such as "Tracking Script – All Pages", and click Save.

  8. Preview the Tag
    Click Preview to test your changes in debug mode. Visit your website to ensure the tag fires correctly.

  9. Publish the Tag
    Once you've confirmed the tag works as expected, click Submit and then Publish to make it live.