Skip to main content
Google Tag Manager loads pagent after your page has started to show. Visitors may briefly see the original before the variant appears. If your platform has a head-code field, paste the snippet there instead: see the other install guides.
Use Google Tag Manager only if you can’t change your site’s code at all.

Copy your client key

In pagent, open the install step, or Settings → Setup later on, and copy your client key from the snippet: the value of data-client-key.

Add pagent as a tag

1

Create a tag

In your container, go to Tags → New → Tag Configuration and choose Custom HTML.
2

Paste the snippet

Paste this code into the HTML field and replace YOUR_CLIENT_KEY with your client key:
Use this instead of the plain snippet. Tag Manager can drop the snippet’s data- settings, and pagent needs them to start.
3

Fire it as early as possible

Under Triggering, choose Initialization - All Pages. It fires before your other page view tags.
4

Save and publish

Save the tag, then click Submit and Publish.
If your container uses consent settings, the tag may only fire after a visitor accepts your cookie banner. See the consent guide for how pagent handles consent.

Check it worked

  1. Open your site in a private browser window, so no cached version shows.
  2. Back in pagent, click Check connection in the install step. If you’ve finished setup already, open Settings → Setup: it shows You are ready once pagent has received visits from your site.
  3. pagent loads your live site and looks for the snippet. When it finds it, you can start your first test.
pagent couldn’t find the snippet? Make sure you published or saved the change on your live site, then check again. If you installed it through Google Tag Manager, open your site once in a normal browser window first.