Custom Visitor Identities
You can provide custom visitor identity information to the Rep.ai dashboard, which will allow you to deduplicate visitors and give customer support agents information about who they're helping.
Code Sample
RepAI("identify",
YOUR_UNIQUE_CUSTOM_ID, // String or integer, replace with your own custom unique value
{
email: "[email protected]", // REQUIRED: Required to create or associate a contact with the visitor.
displayName: "Jessie", // Changes the name of the visitor in the dashboard
avatar: "https://example.com/avatar.png", // Changes the avatar of the visitor in the dashboard
tag: "PAID_PLAN", // or "NEW_PLAN" or "TRIAL_PLAN": Adds an icon next to the visitor name in the dashboard
anyDataYouWant: "hotdogs", // Any other custom data can be added as well
},
);Custom Metadata
The custom data object can provide customer service agents any other details that may be important to the session. The object has a few implementation notes and limits:
The
emailkey is required. Email addresses are used to create or associate a contact with the visitor. If theemailkey is not present the metadata will be ignored.Keys must be JSON-serializable values.
Repeated calls to identify will overwrite previous data, and should be called on every session.
New keys passed into the custom data object will be added on to previous custom data, so you don't have to pass the whole object every time, and can pass keys that you may not have until later into the visitor's session.
If you want to remove a key, you must pass
nullfor its value. Simply omitting it will keep the previous value.
Secure Identities
For security-conscious customers, we recommend validating user identities on your server before identifying them to Rep.ai. This is done by generating a unique hash of the visitor's identity before sending it to Rep.ai, using a secret key on your server.
You only need to hash the custom user ID, and optionally the email if you're providing one in the custom metadata. Below are examples of how to generate this hash on your server.
You'll take the hash generated from your server and add it as the third argument to the RepAI("identify") call, like so.
You can retrieve your secure identity secret key from the Security Settings page on the Rep.ai dashboard. Once you've implemented everything above, you can toggle on requiring secure identities. This will cause any identity sent without a valid hash to be rejected.
Last updated