Skip to main content
In some cases you might want to forward events that pagent tracks to your own tooling. For this purpose, you can setup an event listener on the pagent:event bus on the window object and receive all events that pagent is tracking or creating. Here is an example:
Note: If no session is active, pagent will not emit any events on the pagent:event bus.

Event types

Below is an overview of all event kinds that pagent emits.

Common properties

The following attributes are included in every event:

session_start properties

The session_start event is the one that carries the visitor’s experiment context. When the visitor is enrolled in a running test, it includes the following additional properties (alongside the common properties above):
Note: All of these experiment fields are absent (or null) when there is no active pagent test on the current page — for example analytics-only sessions or visitors not enrolled in any running test. Always check event.experiment_id before reading the others, as the JENTIS example below does.

Example integration

You can also forward individual pagent events to other analytics platforms. The following example shows how to send the conversion event to JENTIS using its push-based data layer:
This keeps your implementation lightweight. You only need to listen for pagent events and decide which ones you want to forward. The example above listens exclusively for the conversion event and immediately submits it to JENTIS.