Set it up
- In pagent, open Integrations and click Configure on the Tag Managers card.
- Under Destinations, turn on one or more:
- Google Tag Manager pushes to
window.dataLayer. If your container uses a different array, change dataLayer name. - JENTIS pushes to the JENTIS tag (
_jts) once it has loaded. Events fired before that are queued for up to 30 seconds. - Custom dataLayer pushes into any named window array, for Tealium, Adobe Launch, Piwik PRO or your own. Enter the Array name.
- Google Tag Manager pushes to
- Optionally change the Field prefix (default
pagent_). It is prepended to every event name and field. - Under Forwarded events, choose what to send. See below.
- Save. Your site picks up the change within a minute.
pagent_assignment event on page load.
Forwarded events
Raw analytics (clicks, scrolls, hovers) is never forwarded. Visitors who opted out of pagent are never forwarded. Anything else, including what your tags do with the data, follows your tag manager’s own consent setup.
Test assignment
Assignment is pushed again on every page view, because tag managers start a fresh data model on each page load. That way your own tags always have the test context available as dataLayer variables.pagent_experiments and pagent_tests list all of them in both pushes; pagent_tests joins them with |.
Conversions
All conversions share thepagent_conversion event name, with the goal in a field. That way renaming a goal never breaks a GTM trigger.
Forwarded conversions are the ones the SDK records in the browser: click goals, page view goals and deprecated programmatic conversions. Event goals are not forwarded, because pagent computes them from your events after the fact. Events observed from your dataLayer are already in your tag manager. For events you send with
window._pgnt.push, push the same event to your dataLayer as well, or forward it from the pagent:event listener.Using it in GTM
A typical GA4 setup:- Create Data Layer Variables for
pagent_experiment_id,pagent_variation_idandpagent_test. - Create a Custom Event trigger on
pagent_assignment. - Add a GA4 Event tag, for example
experience_impression, that sendspagent_testas a parameter and fires on that trigger.
_pagent_forwarded: true. pagent ignores those entries when it observes your dataLayer, so forwarded conversions are never counted a second time as events.
Before forwarding existed
Earlier integrations forwarded data with a hand-writtenpagent:event listener, as in the JENTIS example. That still works. If you switch to forwarding, remove the listener so events are not sent twice.