How to Add PageTest.AI to Your Website Using Google Tag Manager

How to Add PageTest.AI to Your Website Using Google Tag Manager

Ian
Written by IanLast update 14 days ago

If you're managing your website's scripts through Google Tag Manager (GTM), you're in luck—adding the PageTest.AI JavaScript snippet is fast, flexible, and easy to control.

This guide walks you through the steps needed to install the PageTest.AI tag using GTM so you can start running live content tests across your website.


Step 1: Sign in and Navigate to Your Website Settings

Once you’ve signed up for a PageTest.AI account and added your first website, head to the Websites section in your dashboard. You’ll see a list of all the domains you’ve connected.

✅ Tip: If you haven’t added your domain yet, click the “Add New Website” button in the bottom right.


Step 2: Get Your JavaScript Snippet

Next to each website listed, you’ll see a “JS” button. Click this to open your site-specific JavaScript snippet.

Then simply click “Copy to Clipboard.” This is the snippet you’ll be adding via Google Tag Manager.


Step 3: Open Google Tag Manager

Now head over to your Google Tag Manager dashboard.

  1. Select the container for your website.

  2. Click “Tags” in the left-hand menu.

  3. Click “New” to create a new tag.


Step 4: Create a Custom HTML Tag

  1. Name your tag something like PageTest.AI - JS Snippet.

  2. Click “Tag Configuration”, then choose “Custom HTML.”

  3. Paste the JavaScript snippet you copied from your PageTest.AI dashboard.


Step 5: Set a Trigger

Now assign a trigger so your tag knows when to fire:

  • For most users, choose “All Pages” if you want the PageTest.AI tag to run site-wide.

  • Alternatively, you can assign it to specific pages if you're running tests on a limited set.

🎯 The trigger you choose defines where your content tests will be active.


Step 6: Save and Publish

  1. Click “Save” to confirm your new tag.

  2. Then click “Submit” and publish the changes to your live site.

Once published, the PageTest.AI script will begin running wherever your triggers are active—allowing your content tests to go live.


That’s It!

If you're already familiar with GTM, this process will feel very familiar. It's the easiest way to manage and update the PageTest.AI script without editing code directly.

💡 Prefer another method? We also offer a WordPress plugin, Shopify app, and direct embed options.

For more help, check out our other integration tutorials or reach out via the chat bubble in your dashboard.

👉 Ready to start testing? Sign up free at PageTest.AI


Happy testing! 🎯

Did this answer your question?