Advanced tracking with cookies

From Genesys Documentation
Jump to: navigation, search
This topic is part of the manual Journey JavaScript SDK for version Current of Genesys Predictive Engagement.

Learn how to use the Journey JavaScript SDK to refine how Genesys Predictive Engagement tracks visitor data. Alternatively, you can refine tracking using your preferred tag manager. For more information, see About event tracking with tag managers.

About web messaging

Feature coming soon: Web messaging
This article only applies to customers using web chat. If you are a Genesys Cloud customer, we encourage you to use the new web messaging feature to replace web chat. To use web messaging, you configure tracking through the Messenger JavaScript SDK instead of deploying a tracking snippet.


About advanced tracking

Use init options to change how Genesys Predictive Engagement sets cookies and how you track your visitors across subdomains or multiple domains.

Cookie options

By default, the Journey JavaScript SDK sets the cookie expiration date and determines the cookie domain. To customize these settings, use the following parameters with the init method.

me Description Default
allowedLinkers Array of domains that can link into the current domain for cross-domain tracking. Null
autoLink Augments all links to the specified domains on the site to contain information that allows the linked page to continue the current tracking session. Null
cookieDomain Determines the domain on which the cookies are set. The highest level domain possible
cookieExpires Specifies the expiration time in seconds for the actmi, _actmu and _actvc cookies. For example, 1 year = 365 days * 24 hours * 60 minutes * 60 seconds = 31536000 seconds. 1 year
cookiePrefix Adds a prefix to the names of the Genesys Predictive Engagement cookies. "_" (underscore)

Example

ac('init', 'YOUR-ORGANIZATION-ID', {
  region: 'YOUR-REGION',
  cookieDomain: 'YOUR-DOMAIN',
  cookieExpires: 31536000,
  cookiePrefix: 'YOUR-PREFIX'
});

Track a domain and its subdomains

By default, to simplify cross-domain tracking implementations, Genesys Predictive Engagement writes cookies to the highest level domain possible. If you manage both a domain and one or more subdomains such as www.example.com, blog.example.com and store.example.com, the cookie domain used to store cookies will be .example.com.

Tracking subdomains in 2 different accounts

For tracking subdomains separately in 2 different accounts, you need to customize the Genesys Predictive Engagement tracking snippet to specify the desired domain in the init call:

 
ac('init', 'YOUR-ORGANIZATION-ID', {
  region: 'YOUR-REGION',
  cookieDomain: 'subdomain.example.co.uk'
});

Track multiple domains

A default setup tracks traffic to each domain (for example: example.com and example.co.uk) independently. Therefore, a visitor arriving in one domain who then proceeds to another domain that is set up with the same tracking account counts as two separate visitors with two separate visits or sessions. Each one comprises the activities (pages visited, and so on) that occurred on each domain.

To enable cross domain tracking, also known as site linking, to bundle together the traffic to both domains, modify the init call in the Genesys Predictive Engagement tracking snippet to allow auto linking to another domain. Suppose you have a site, example.com that links to example.co.uk and in opposite manner.

To enable tracking across both of these domains, modify the following in the Genesys Predictive Engagement tracking snippet in example.com:

 
ac('init', 'YOUR-ORGANIZATION-ID', {
  region: 'YOUR-REGION',
  allowedLinkers: ['example.co.uk'],
  autoLink: ['example.co.uk']
});

Then, modify the Genesys Predictive Engagement tracking snippet in example.co.uk to also allow linking. Specifically, to accept the visitor tracking cookies from another site, and to enable auto linking to decorate all links pointing to example.com:

 
ac('init', 'YOUR-ORGANIZATION-ID', {
  region: 'YOUR-REGION',
  allowedLinkers: ['example.com'],
  autoLink: ['example.com']
});


Asymmetric site linking

You can set up asymmetric site linking. It allows you to carry cookies from example.com to example.co.uk but not the other way around. The Genesys Predictive Engagement tracking snippet in example.com removes example.co.uk from allowedLinkers, and removes autoLink from the Genesys Predictive Engagement tracking snippet added to example.co.uk.