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 Genesys Predictive Engagement.

Learn what happens after you deploy the tracking snippet on your webpages. Not what you're looking for? Try About tracking with Genesys Predictive Engagement instead.

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. Therefore, most of the content in this guide is not applicable to web messaging. To start tracking, see Configure messenger in the Developer Center.

How the tracking snippet works

Genesys Predictive Engagement provides a traditional tracking snippet and an SPA tracking snippet to track activity on your webpages. For more information, 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, we cache the Journey JavaScript SDK in the visitor's browser and load it asynchronously.

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

Once loaded, the Journey JavaScript SDK:

  • Creates a new script HTML element
  • Sets the source attribute to the Genesys Predictive Engagement 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 Genesys Predictive Engagement SDK to 'ac'
  • Calls the ac function and runs 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 loads, allowing Genesys Predictive Engagement to track the visitor's journey across the website.

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