Tracking snippet

From Genesys Documentation
Jump to: navigation, search
This topic is part of the manual Altocloud Administrator's Guide for version Current of Altocloud.

Deploy the Altocloud tracking snippet to enable visitor tracking on your website.

About the tracking snippet

To enable tracking on your website, you must deploy the Altocloud tracking snippet. The following code is the Altocloud tracking snippet that enables you to track visitor activity on your webpages.

  (a[o].q=a[o].q||[]).push(arguments)},a[o].l=1*new Date();u=t.createElement(c),
  })(window, document, 'script', '', 'ac');
  ac('init', 'a061a3fe-7a80-4b50-9d3b-df88c0f9efad', { region: 'use1' });

For more information about how the tracking snippet and the Journey JavaScript SDK work, see About the tracking snippet.

Copy the snippet

  1. Click Admin.
  2. Under Altocloud, click Tracking Snippet.
  3. Copy the code. Altocloud automatically populates your organization ID and region.
  4. Paste the Altocloud tracking snippet in the element of the website template page before the closing tag.
  • Since you are logged in to the Admin UI, the Altocloud tracking snippet already contains your organization ID and your Genesys region.
  • If you are concerned about using Altocloud in a GDPR-compliant manner, see GDPR.
  • The last argument in the Altocloud tracking snippet is 'ac'. If your webpage or any third-party JavaScript uses this variable name globally, pass a custom value.
  • When you call `ac`, the commands after it, such as init, pageview, and so on, are queued. When the website template file is completely downloaded, the queued commands are executed.

Deploy the snippet with a tag management system

To easily deploy the Altocloud tracking snippet, use a tag management system such as Google Tag Manager, Tealium, Adobe Dynamic Tag Manager, and any others that provide the option to add custom JavaScript code.

Do not deploy the Altocloud tracking snippet on any page that collects payment information.

Notes for using a tag manager

  • Execute the tracking snippet on the main window of the website you want to track.
  • Do not execute the tracking snippet in an iframe.
  • When properly executed and initialized, the pinging should be frequent (once every 4-5 seconds), and it should return status code 200.
  • When you copy the tracking snippet into your tag manager, omit both <script> and </script> tags.


Enhance your tracking


If the tracking snippet does not work properly when you load it on your web pages, check the following things:
* Is the snippet on the correct page?
* Is the snippet correctly placed in the header?
* Are all of the parameters specified correctly?
* Are there any typos, missing characters, or extra white space?

If you copy and paste the tracking snippet into an email or other editing program, that program may insert or replace characters in the tracking snippet. If you need to copy and paste the tracking snippet, use a text editor to ensure a clean copy and paste.

Error reference

Error code Description
403 error Is your domain in the list of allowed domains?

Are the requests (for example, pings) going to the correct region?

404 error Is there extra white space in the snippet?

Note: In a URL, white space is encoded as %20.

Bad request Is there extra white space in the snippet?

Note: In a URL, white space is encoded as %20.

Initialization error Are there any of the following in the snippet:
  • Typos
  • Missing characters
  • Dashes and quotes in URLs replaced with printable equivalents