About the tracking snippet

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

Learn what happens after you deploy the tracking snippet on your web pages. Not what you're looking for? Try About tracking with Altocloud instead.

How the tracking snippet works

Altocloud provides a traditional tracking snippet and an SPA tracking snippet to track activity on your webpages. For information about these different types of snippets, see Types of snippets.

When you add the snippet to a webpage, the tracking snippet loads the Journey JavaScript SDK whenever a visitor accesses a tracked page. To ensure that the process of loading the Journey JavaScript SDK does not cause the visitor to wait for the page to load. Instead, we cache the Journey JavaScript SDK in the visitor's browser and load it asynchronously.

  • The Altocloud tracking snippet loads JavaScript asynchronously without slowing down page loading.
  • The Altocloud SDK does not block the loading of any other resources.
  • This snippet represents the minimum configuration needed to add the Altocloud customer support widget. To start sending tracking data from your visitors back to the Altocloud servers, see Web Tracking API.

Once loaded, the Journey JavaScript SDK:

  • Creates a new script HTML element
  • Sets the source attribute to the Altocloud SDK’s URL
  • Sets the async attribute to 1 ( truthy)
  • Adds the script element to the DOM
  • Sets the name of the only global function exposed by the Altocloud SDK to 'ac'
  • Calls the ac function and executes the following commands:
    • init to set the organization ID and region, and to specify which account to send the data to
    • pageview to record an event when a page with the tracking snippet is loaded, allowing Altocloud to track the visitor's journey across the website.

For more information about the the tracking method, see Web Tracking API.