Page tree
Skip to end of metadata
Go to start of metadata

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 Explains

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.

Sections in this Article

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.

Integrating the Beacon

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

  1. Log into Interaction Studio as an administrator
  2. Select Web > JavaScript Integration
  3. If you have more than one dataset, select the one you want from the dropdown at the top left of the Interaction Studio window
  4. Select the tab for the beacon type: Synchronous or Asynchronous
  5. 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 Interaction Studio JavaScript beacon. Your tracking beacon is unique to your Interaction Studio account and dataset, so please be sure to use the correct JavaScript code found under each dataset in your Interaction Studio account.

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.

  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. Confirm that 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 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.

  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 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>