Tracking snippet
Contents
Deploy the Genesys Predictive Engagement tracking snippet to enable visitor tracking on your website.
Prerequisites
Configure the following permissions in PureCloud:
- Journey > Settings > Edit, or View permissions
About the tracking snippet
The following code is the Genesys Predictive Engagement 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;u.charset='utf-8';d.parentNode.insertBefore(u,d)
})(window, document, 'script', 'https://apps.inindca.com/journey/sdk/js/web/v1/ac.js', 'ac');
ac('init', 'a061a3fe-7a80-4b50-9d3b-df88c0f9efad', { environment: 'dev' });
ac('pageview');
</script>
Copy the snippet
- Click Admin.
- Under Altocloud, click Tracking Snippet.
- Copy the code. Genesys Predictive Engagement automatically populates your organization ID and region.
- Paste the Genesys Predictive Engagement tracking snippet in the element of the website template page before the closing tag.
- Since you are logged in to the Admin UI, the Genesys Predictive Engagement tracking snippet already contains your organization ID and your Genesys region.
- If you are concerned about using Genesys Predictive Engagement in a GDPR-compliant manner, see GDPR.
- The last argument in the Genesys Predictive Engagement 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 Genesys Predictive Engagement 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.
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
For information on how to enhance how you track visitors on your website, see smart tags.
Troubleshooting
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?