Skip to main content
pagent loads early and reacts to your visitors’ consent: it reports pseudonymous data before consent and stores its persistent cookies only after an opt-in. Two cookies are set without it: _pgnt-seed, which keeps test groups stable for a day, and _pgnt-opt-in, which stores the visitor’s choice. List them in your cookie declaration. Your cookie banner tells pagent about the visitor’s choice through two commands. See the consent guide for how pagent handles consent, including the strict option that holds back all data until opt-in.

1. Add pagent as a service

In the Usercentrics admin, add pagent as a custom service named pagent in the category you use for analytics. The script below looks the service up by that name.

2. Keep Usercentrics from blocking pagent

With auto-blocking, mark the pagent snippet with data-uc-allowed="true", so it loads before the page shows:
Add the script for your Usercentrics version after the pagent snippet.
This reads the visitor’s stored choice when the page loads, and listens for the UC_CONSENT event whenever the choice changes:

Check it worked

  1. Open your site in a private window and accept the pagent service.
  2. In your browser’s developer tools, check that pagent’s cookies starting with _pgnt appear.
  3. Reopen the privacy settings, deny pagent, and check that they’re removed again, except _pgnt-seed and _pgnt-opt-in, which now reads false.