In order to pass data to Evergage, you'll need to install a snippet of JavaScript tracking code.  Depending on what you are tracking, you may or may not need to modify the code.  To help you out, we have a set-up wizard that will walk you through several options then provide the tracking code needed.


To access the wizard select the relevant dataset and navigate to Settings > Integration > Setup.

 

To get started, check off the relevant boxes. Some key points:

Track Accounts - Enable this option if you have the concept of accounts in which multiple users access a single account. This is primarily used for tracking applications and websites of B2B companies. ex: Salesforce.com tracks accounts, as many sales reps from the same company could log into SalesForce.

Track Subdomain as Account - Enable this option if your app is set up so that the subdomain changes based on the logged in account (e.g. accountname.yoursite.com). If enabled, Evergage will automatically assign the subdomain as the account name.

Track Anonymous Visitors - Enable this option if Evergage will be tracking a public website that does not always require a log-in.

Merge Anonymous Users - Enable this option to merge all Evergage data on an anonymous user when they log in as a known user.

Enable Campaigns - Enable this option if you plan to use Evergage campaigns on your site.

Enable Campaign Request Security - Enable this option to secure messages by ensuring only intended users can see them. This is useful if you'll send personal info in a message (name, amount owed, etc.). If you plan on using messages to guide users or share more public information (such as product information) this is optional. Note: If you select this option it will require work from an engineer to add code to your server to handle the security. You can find this code in the Settings > Integration > JavaScript tab under Encrypted UserId Generation Code.

Enable Dynamic Message Content  - Enable this option to add dynamic content into a message. An example of this would be inserting a user's name, account name, company name, or location into a message.

Sandbox Unsafe Content - Enable this option to disable HTML in messages, which is a security protocol to prevent users from placing potentially harmful content in the Evergage message. For example, this will prevent JavaScript, iframes, jQuery, or video from being loaded into a message. If any HTML or code in your messages will be developed in house or by very trusted partners, then you can uncheck this option to enable HTML in your messages.

Treat Hash Changes in Location as New Page Loads - Enable this option if your page changes when the content after the "#" in the URL changes.

Allow Users to Switch Accounts - Enable this option if users are able to login to multiple accounts with the same userId, and you wish to include the user in the most recent account. For example, a user logs in to account1, then switches to account2  while still using the same userId. If this option is checked off, the user was most recently active in account2  and will therefore belong to account2 until the user logs in to another account. With this option unchecked, the user will stay assigned to the account of first login, in this case, account1.


After you have configured your dataset appropriately, click SAVE

After you save, select the Javascript tab to the left

In this tab you'll get the javascript you need an engineer to add to every page in your product, preferably in the header so it loads first.  Please note our code is asynchronous and will not impact your product's load time or functionality.

Before placing the code in your product, please check to see if you need to pass user data to Evergage here: Install the JavaScript Beacon

1. UserID

To explicitly pass the userId to Evergage your engineer will need to add userId to the tracking code by adding the following line:

_aaq.push(['setUser', SET_TO_CURRENT_USER]);
Just write a function to replace "SET_TO_CURRENT_USER" with the userID of the logged in user.

2. Account

To pass the account name to Evergage, your engineer will need to account the account the user is logged into by adding the following line to your tracking code:

_aaq.push(['setCompany', SET_TO_USERS_COMPANY]);
Just write a function to replace "SET_TO_USERS_COMPANY" with the account of the logged in user.  
Please note, it is very important if you take this approach to include it on every page you have the JavaScript, please don't just add it to the login page.  You need to pass the account Id with every action.

3. Account Type

The final piece of information is the lifecycle state of your customer, for example a free trial vs. paid customer.  

If you use Salesforce or SugarCRM, we can integrate with these platform and capture the data from there. If not, and you do want to capture the lifecycle state of your customers, an engineer will need to add the following line to the tracking code:


Just write a function to replace "SET_TO_SUBSCRIPTION_LEVEL" with the subscription level for the current logged in user.

Once you've finished adding any necessary code to the JavaScript on the JavaScript tab, just ask your engineer to install the code.