The Interaction Studio JavaScript beacon places a first party cookie on the visitor's browser which sends data for that visitor back to Interaction Studio. 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 reviews 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 Interaction Studio 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 two types of Interaction Studio integrations that can be done with the Interaction Studio JavaScript Beacon:
- Synchronous–recommended for most customers, this integration loads the beacon before the page loads so Interaction Studio can prevent page flicker, a momentary flash of the original page content
- Asynchronous–not recommended because this integration loads the beacon after the page has loaded. With this integration, Interaction Studio cannot protect against flicker
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 Interaction Studio. For more specific details, please refer to the article on the JavaScript Beacon Library of Functions.
The hybrid beacon integration is no longer supported by Interaction Studio.
Add Campaign Request Security
Campaign Request Security is an option in your Interaction Studio 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 Interaction Studio will not process events for this user.
NOTE
Enable Campaign Request Security requires custom code to Encrypt userIDs on your site.
Encrypted Fields is an option in your Interaction Studio 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 Interaction Studio will not send this field value to Interaction Studio for this user.
NOTE
Enable Encrypted Fields requires custom code to Encrypt user fields on your site.
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 Interaction Studio 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 Interaction Studio. 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:
<script type="text/javascript"> var _aaq = window._aaq || (window._aaq = []); _aaq.push(['setUser', mySitesUsername]); </script> <script type="text/javascript" src="//cdn.evgnet.com/beacon/mycompany/mydataset/scripts/evergage.min.js"></script>