Manage User Tracking in Gainsight PX
This article explains how to prevent Gainsight PX from associating tracked activity with a specific user's identity by skipping the identify call.
Limit User Tracking
By default, Gainsight PX identifies and tracks all users who trigger the identify call. To prevent PX from associating tracked activity with specific users, a developer can conditionally modify the identify code so that the identify call is skipped for those users.
Skip the Identify Call for Specific Users
A developer can conditionally modify the identify code to prevent PX from associating tracked events with specific users. When the identify call is skipped for a user, PX tracks their activity anonymously instead of linking it to a named user record.
This approach does not prevent the PX tag from loading or stop event collection. The user's activity is still tracked anonymously and stored in PX, only the identity association is suppressed. The tracked data is not available in reports and is only reflected in the anonymous usage widget on the dashboard.
Before implementing this approach, identify which users should still be identified in PX, for example, internal team members who test engagements in the production environment. Suppressing the identify call for all users prevents your team from qualifying for engagement audience rules, which breaks engagement testing.
The following example skips identification for users with a specific email domain while continuing to identify all other users:
//passing user and account objects:
if(!email.endsWith("example.com"))
aptrinsic("identify",
{
//User Fields
"id": "unique-user-id", // Required for logged in app users
"email": email,
"firstName": "John",
"lastName": "Smith",
"signUpDate": 1522697426479, //unix time in ms
"plan" : "gold", //Custom attributes - please create those custom attributes in Aptrinsic via Administration to be tracked.
"price" : 95.5,
"userHash": "" // optional transient for HMAC identification
},
{
//Account Fields
"id":"EM", //Required
"name":"Email Monkey",
"Program": "Platinum" // flat custom attributes
});