Skip to content

Gainsight PX

Run Gainsight PX analytics and in-app engagements under one consent choice. On withdrawal, c15t turns the PX tag off through the PX config API.

Works with Next.js, TanStack Start, React, Nuxt, Vue, Astro, Svelte, SvelteKit, HTML and JavaScript

Inth keeps the consent record of each choice, with the visitor’s country and the policy that applied.

Start for free
pnpm add @c15t/integrations
Gainsight PXWaiting for consent
Before a choice

No request goes to web-sdk.aptrinsic.com or esp.aptrinsic.com. There is no window.aptrinsic and no apt.uid or apt.sid storage.

Turn the switch on, then off, to see what loads.

Before you start

You need an Inth project that connects to your app and c15t in that app. You also need the product key from Administration, then Products, in Gainsight PX.

New to c15t? Complete the quickstart for your framework first. Keep its Inth endpoint, policy, styles and consent UI.

Open the quickstart for your framework

How consent gets to Gainsight PX

The c15t gainsightPx helper creates no window.aptrinsic and requests no PX SDK before measurement has permission. The same gate covers product analytics and in-app engagements.

After permission, the helper builds the PX queue, turns the tag on and loads the SDK. If you pass user, it queues identify too.

On withdrawal, the helper sends aptrinsic('config', 'enableTag', false) and then a reset. Gainsight says that enableTag: false stops PX cookies, network calls and engagements.

Use category to pick a different consent category, such as experience. c15t owns enableTag, so do not set it in config.

Read the Gainsight PX config API guide

Installation

Gainsight PX has one load mode in c15t. The helper waits for measurement permission.

Wait for permission. No request goes to Gainsight PX until the visitor accepts measurement. On withdrawal, the helper turns the PX tag off.

gainsightPx({ productKey })

An opt-out policy or no policy gives optional categories permission before a choice. Then Gainsight PX loads on the first page. This guide uses an opt-in policy.

Setup steps

  1. Install the integration package

    Add the helpers next to c15t. An import alone does not start the PX SDK.

    pnpm add @c15t/integrations
  2. Add your product key

    The helper sends the product key to the PX loader. Pass config, user and account with JSON values only.

    src/consent-scripts.ts
    import { gainsightPx } from '@c15t/integrations/gainsight-px';
    
    export const scripts = [gainsightPx({ productKey: 'AP-PRODUCT-KEY-2' })];

    An empty product key logs an error, and PX does not load. A change of productKey or config after PX starts throws an error. Reload the page to change them.

  3. Register it with your existing setup

    Add scripts to the c15t configuration that you have now. Keep your Inth endpoint, mode, policy, styles and consent UI.

    Add scripts to c15t.config.ts, next to next.config.ts. Keep the rest of your config, such as mode, in the same call. App Router, Pages Router and static export read the same file.

    c15t.config.ts
    import { defineConsentConfig } from 'c15t/next';
    import { scripts } from './src/consent-scripts';
    
    export default defineConsentConfig({ scripts });
All frameworks

Remove the old PX snippet and each tag manager copy, so PX loads only through c15t. Keep reloadOnConsentRevoked on, because the reload stops PX timers and listeners.

Verify your setup

Use a private window with an opt-in policy. Open DevTools Network and Application, and filter by aptrinsic. Then test the three states.

  • Before a choice

    No request goes to web-sdk.aptrinsic.com or esp.aptrinsic.com. There is no window.aptrinsic and no apt.uid or apt.sid storage.

  • After you allow measurement

    The PX SDK loads without a page reload. Your PX product gets the events that you expect.

  • After you withdraw measurement

    Save your choice. c15t reloads the page. The new page sends no request to Gainsight PX.

c15t does not gate PX calls in other parts of your app. Call identify after a login only while the visitor still gives permission.

Open the full Gainsight PX guide