About the tracking snippet

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

Use the Altocloud tracking snippet to track visitor activity on your webpages.

About the tracking snippet

The following code is the Altocloud tracking snippet that enables you to track visitor activity on your webpages.

<script>
  (function(a,t,c,l,o,u,d){a['_genesysJourneySdk']=o;a[o]=a[o]||function(){
  (a[o].q=a[o].q||[]).push(arguments)},a[o].l=1*new Date();u=t.createElement(c),
  d=t.getElementsByTagName(c)[0];u.async=1;u.src=l;d.parentNode.insertBefore(u,d)
  })(window, document, 'script', 'https://app.genesys.cloud/journey/sdk/js/web/v1/ac.js', 'ac');
  ac('init', 'YOUR-ORGANIZATION-ID', { region: 'YOUR-REGION' });
  ac('pageview');
</script>

For information on how to deploy the Altocloud tracking snippet, how to use it in a GDPR-compliant manner, and other related topics, see the following links:

Important
If you copy and paste the tracking snippet from the Altocloud Admin UI, the values for your YOUR_ORGANIZATION_ID and YOUR_REGION are automatically populated for you. For information, see Deploy the tracking snippet.

How the tracking snippet works

Altocloud provides a tracking snippet to track activity on your webpages. When you add the snippet to a webpage, the tracking snippet asynchronously loads the Altocloud SDK. It then:

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

Important
  • 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.