Page tree

 

Contents

The Evergage JavaScript beacon places a first party cookie on the visitor's browser which sends data for that visitor back to Evergage. This includes pages visited, links clicked, time on site, number of visits, geolocation, and referral source, as well as other custom data you want collected. 

This article will review the types of beacons available and how to select the right one for your site, how to determine if you need to make any configuration changes to track additional information or add additional security, and how to integrate the beacon into your site:

Beacon Installation Checklist

  • Use Evergage beacon version 4 or later (adjust it in SETTINGS > Beacon Version)
  • Point the integration to the right protocol (https or http). You can also omit the protocol and include //cdn.evgnet.com...
  • Insert the synchronous integration script
  • Insert any other _aaq.push() calls needed before the script
  • Review the differences in page load events

Integration Types

There are three types of Evergage integrations that can be done with the Evergage JavaScript Beacon:

  • Synchronous–recommended for most customers, this integration loads the beacon before the page loads so Evergage can prevent page flicker, a momentary flash of the original page content
  • Asynchronous–this integration loads the beacon after the page has loaded. With this integration, Evergage cannot protect against flicker
  • Hybrid–this integration supports ZeroFlicker but doesn't require you to point to the Evergage tag synchronously. Instead, a much smaller piece of code either loaded directly onto your site in a script tag, or hosted on your CDN or web hosting provider. Additionally, you point asynchronously at the standard Evergage tag. The trade-off here is that every time you want to change the sections that you target ZeroFlicker campaigns at, or the maximum redisplay timeout, you have to update the evergageFlickerDefender.min.js that you are hosting. For more specific details, please refer to the article on Synchronous vs. Asynchronous Integration.

Once you place the JavaScript beacon code on your site, it will start collecting data. Prior to doing so, you may want to modify the integration code so you can pass user fields (e.g. user ID, user first name, user email) to Evergage. For more specific details, please refer to the article on the JavaScript Beacon Library of Functions.

 

Integrating the Beacon

To access the JavaScript integration code, you must be an Evergage administrator at your company.

  1. Log into Evergage as an administrator
  2. Select SETTINGS
  3. In the Integration section, select JavaScript
  4. If you have more than one dataset, select the one you want from the dropdown at the top left of the Evergage window
  5. Select the tab for the beacon type: Synchronous, Hybrid, or Asynchronous
  6. Copy the code as directed on the screen and place it into the header of your site to ensure that the beacon is loaded on every page of the site

 

Beacon Example

This is an example of an Evergage JavaScript beacon. Your tracking beacon is unique to your Evergage account and dataset, so please be sure to use the correct JavaScript code found under each dataset in your Evergage account.

Add Campaign Request Security

Campaign Request Security is an option in your Evergage integration which makes campaigns and other tracking more secure. This option requires you to write code for your site to properly encrypt userIDs with an API token. If a user's ID cannot be properly decrypted, then Evergage will not process events for this user.

NOTE

Enable Campaign Request Security requires custom code to Encrypt userIDs on your site.

  1. Expand the Encrypted User ID Generation Code section for an example of how to encrypt userIDs on your site
  2. Select the Programming Language (Java, Ruby, or PHP)
  3. Work with your Customer Success representative to ensure you are properly encrypting userIDs before enabling this option on in your dataset

Example of Encrypted UserID Generation Code

This is an example of encrypted userID generation code, for illustration purposes only. You will need to write custom code for your own site to properly encrypt userIDs with an API token.

Add Encrypted Fields

 

Encrypted Fields is an option in your Evergage integration to make field tracking more secure. This option requires code to be written on your site to encrypt values so they are not readable by the browser or browser's cache. If a field value cannot be properly decrypted then Evergage will not send this field value to Evergage for this user.

NOTE

Enable Encrypted Fields requires custom code to Encrypt user fields on your site.

  1. Expand the Encrypted Fields Generation Code for an example of how to encrypt userIDs on your site
  2. Work with your Customer Success representative to ensure you are properly encrypting these fields before turning this option on in your dataset

Example of Encrypted Fields Generation Code

This is an example of encrypted fields generation code, for illustration purposes only. You will need to write custom code for your own site to encrypt values so they are not readable by the browser or browser's cache.

 

Tracking Additional User Information

Depending on what additional information you would like to collect, you may need to adjust the beacon code before you place it in your site. Typically, there are three additional pieces of information you may want to gather about logged in site or product visitors.

UserID

If the userID is visible after a user logs into your product or site and login is required on a regular basis, you do not need to modify the beacon code because we can track the userID on the login page. Be aware that userID must be a unique identifier (i.e. email address) and first initial last name is not recommended because multiple users could have the same first initial and last name. Otherwise, please refer to the JavaScript Beacon Library of Functions.

Company/Account

If the account of the logged in user is visible in your site or product or if you include the account name in the subdomain of your URL when logged in (i.e. accountname.evgnet.com) then you do not need to modify the beacon code for Evergage to determine the account associate with the logged in user. Otherwise, please refer to the JavaScript Beacon Library of Functions.

Account Type/Subscription Level

If you store account type or lifecycle state of your customers in your Salesforce or SugarCRM then you can use these services to pass the data to Evergage.  If you want to capture this information, but are not using Salesforce or SugarCRM, an engineer will need to add the account the user is logged into to the tracking code as outlined in the JavaScript Beacon Library of Functions.

Sample Code Block

You will need to include two script tags if you adjust the beacon code to capture other variables, like UserID.  In the first script tag, define these variables and in the second, define the beacon, in that order as user info must be loaded before the beacon. For example, if you are defining the UserID in a variable called mySitesUsername, it would look something like this:

This page has no comments.