All of the functions in this document rely on being pushed to our "_aaq" array in the following format:
Track User and Account Data
Encrypted User ID
If you are enabling message security (recommended if messages will contain private data), you must pass the Encrypted User ID to Evergage.
Used to tell Evergage who the current user is. You must pass either the User ID or Encrypted User ID to Evergage in order to successfully track events.
Used to set the customer's lifecycle or subscription type (e.g. free trial, freemium, paid-basic, paid-premium)
User Display Name
Used to set the user's display name in Evergage. By default the User Display Name will appear alongside the UserID on the dashboard. Use Search to find a specific value.
Sets the user's email address in Evergage. If you're not passing the email as the UserID but still have access to this data, you can pass it separately.
Account Display Name
Similar to the User Display Name, the Account Display Name will appear alongside Company/Account on the dashboard. Use Search to find a specific value.
Other Custom Fields
Used to pass custom fields to Evergage, such as demographic data, user role, or any other numeric or text data.
The context argument can be one of the following case sensitive calls:
- request: sends the custom attribute once. Evergage recommends using this call to pass custom fields
- page: sends the custom attribute every time a viewer performs an action on the page
- visit: sends the custom attribute with every action on any page for the remainder of the visit. A visit is defined in Evergage as lasting as long as the visitor keeps performing actions without a 30-minute gap
To implement, first replace the capitalized words with the appropriate variable (strings, booleans, integers, or floats only)
Then, add the following after the variable "_aaq" has been established:
Track Data Using On-Page Actions
This line will track actions within Evergage, like an on-click action of a link. However, Evergage will only receive data when an action occurs. For example, after using the setCustomField command, add a track action call after it so Evergage captures the data.
Example of an on-click event passing a custom field and action:
Clear User and Account Data from Your Cookie
By default Evergage will record your userId and your accountId on your cookie. If at any point you would like to clear this data you can remove all user data associated with this cookie by calling the function:
You can also clear your current account information with:
Please note that the clearUser() function will also call clearCompany() to completely disassociate all user data.
This page has no comments.