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
Before you begin
Before you deploy the Genesys Predictive Engagement tracking snippet be sure you understand:
- How to deploy the tracking snippet to be compliant with General Data Protection Regulation (GDPR)
Deploy the tracking snippet
To deploy the tracking snippet:
Get the snippet
- Click Admin.
- Under Altocloud, click Tracking Snippet.
- Select the type of snippet you need.
- Copy the code.
- Since you are logged in to PureCloud, the Genesys Predictive Engagement tracking snippet already contains your organization ID and your Genesys region.
- When you copy the Altocloud tracking snippet into your tag manager, remove both script tags.
- 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.
Types of tracking snippets
Select the appropriate Genesys Predictive Engagement tracking snippet for your environment.
Basic snippet
The basic snippet provides tracking support to traditional webpages that contain little or nodynamic content. Traditional websites load a new HTML page whenever the user navigates to a different URL. To provide tracking support to traditional webpages, the basic snippet calls ac('pageview') each time the a new page is loaded by the web browser.
<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://example.com, 'ac');
ac('init', 'a061a3fe-7a80-4b50-9d3b-df88c0f9efad', { region: 'use1' });
ac('pageview');
</script>
Advanced snippet
The advanced snippet provides tracking support to Single Page Applications (SPAs). SPAs load dynamic content on demand without requiring a hard reload of the HTML page. Additionally, this functionality can trackNo results, which the traditional snippet does not. The SPA snippet works on any framework that you use with your SPA, including Angular, React, Vue.js, and so on.
Where to deploy the snippet
- Deploy the Genesys Predictive Engagement tracking snippet on the main page of the website you want to track.
- Paste the Genesys Predictive Engagement tracking snippet in the element of the website template page before the closing tag.
- Do not deploy the tracking snippet in an iframe.
Tag managers
To easily deploy the Genesys Predictive Engagement tracking snippet, use a tag management system such as:
- Google Tag Manager
- Adobe Launch
- Tealium
Google Tag Manager
Google Tag Manager provides numerous predefined triggers and tags to refine the Genesys Predictive Engagement tracking snippet. For example:
- Click element
- Click class
- Click ID
- Click Target
- Click URL
- Click TextErrors
- Error Message
- Error URL
- Error LineForms
- Form Classes
- Form Element
- Form ID
- Form Target
- Form Text
- Form URLScroll
- Scroll Depth Threshold
- Scroll Depth Units
- Scroll Direction
For complete information on the custom tags that are available with Google Tag Manager, see Custom tags.
Customize the snippet
- If you need to refine how Genesys Predictive Engagement tracks activity on your website, use the predefined custom tags that your tag manager provides. For example:
- If your tag manager's predefined tags do not provide the level of customization you need, customize the Genesys Predictive Engagement tracking snippet with functions from the Journey JavaScript SDK. For example:
Verify that the snippet works
When the tracking snippet is properly executed and initialized:
- You should receive a ping every 4-5 seconds.
- The ping should return status code 200.
Troubleshoot the snippet
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?