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

Learn how to use the Journey JavaScript SDK to refine how Altocloud tracks customer data. Alternatively, you can refine tracking using your preferred tag manager. For more information, see About event tracking.

About advanced tracking

Use init options to change how Altocloud 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 An array of domains that are allowed to link into the current domain for cross-domain tracking Null
autoLink All links to the specified domains on the site will be augmented 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 Altocloud 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, Altocloud will automatically write 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, the Altocloud tracking snippet needs to be customized 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 will track 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 is counted as two separate users with two separate visits/sessions. Each of these 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 Altocloud tracking snippet to allow auto linking to another domains. Suppose you have a site, example.com that links to example.co.uk and vice versa.

To enable tracking across both of these domains, make the following modifications to the Altocloud tracking snippet in example.com:

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

Then, modify the Altocloud tracking snippet in example.co.uk to also allow linking. Specifically, to accept the user 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. In this case, you can carry cookies from example.com to example.co.uk but not the other way around. In this case, the Altocloud tracking snippet in example.com should remove example.co.uk from allowedLinkers, and autoLink should be removed from the Altocloud tracking snippet added to example.co.uk.