Use Google Tag Manager with Genesys Predictive Engagement
About the tracking snippets
Customers who want to use web chat must use the Predictive Engagement tracking snippet. This snippet deploys Predictive Engagement tracking on your website and also allows you to use the web chat feature.
Genesys Cloud CX customers who want to use web messaging instead of web chat must use the Messenger snippet. This snippet deploys Predictive Engagement tracking on your website and also allows you to use the web messaging feature.
About Google Tag Manager
When you use Google Tag Manager to deploy Genesys Predictive Engagement tracking, Genesys Predictive Engagement tracks standard customer journey events including pageviews and form entries. You can also use Google Tag Manager’s prebuilt tags, triggers, variables, to track other events that are specific to your webpage and business needs.
For more information about using Google Tag Manager, see Google’s Tag Manager Help.
With the help of Google Tag Manager, you can deploy:
- Messenger snippet
- Predictive Engagement tracking snippet
Deploy the Messenger snippet with Google Tag Manager
To deploy the Messenger snippet (available to Genesys Cloud CX customers only), complete these steps:
- In Genesys Cloud CX Admin under Message, click Messenger Deployments.
- Click the name of the Messenger deployment to deploy.
- In the Deploy your snippet section, click Copy to Clipboard.
- In Google Tag Manager, create a Custom HTML tag.
- Paste the snippet into the body of the Custom HTML tag.
- Enclose the JavaScript code with <script> tags. Ensure that you unescape the snippet code to remove the new line escaped characters.
- Save the tag.
- Select the All Pages trigger.
- Save the tag with a meaningful name, such as Messenger Tag.
- Click Submit and then click Publish. The tag publishes to all pages on your website.
For more information, see Deploy Messenger in the Genesys Cloud CX Resource Center.
Deploy the Predictive Engagement tracking snippet with Google Tag Manager
This video shows you how to use Google Tag Manager to deploy the Genesys Predictive Engagement tracking snippet on your website.
To deploy the Predictive Engagement tracking snippet, complete these steps:
- In Google Tag Manager, create a new trigger and select DOM Ready as the type.
- Create a new tag and select Custom HTML for the type.
- Configure the tag to use the new DOM Ready trigger.
- In Genesys Predictive Engagement, copy the tracking snippet.
- In Google Tag Manager, paste the snippet in the new Custom HTML tag.
- Save your changes and publish your workspace.
Triggers
A trigger is a condition that defines when a tag must run. Google Tag Manager provides a collection of built-in triggers. You can also create your own trigger.
This example shows the Form Submission trigger, which launches when the visitor clicks Sign up to submit the form.
Tip
Track submission errors with the built-in Element Visibility trigger. If an error message appears on the page, you can assume that the form contains errors and take appropriate actions. You can also track field-related error messages the same way.Example trigger: track when a visitor scrolls
This example shows how to use the Scroll Depth trigger to capture vertical and horizontal scrolling events on webpages.
- This trigger can fire either on all webpages or on a subset of pages that match the conditions that you specify
- Specify the vertical and horizontal scroll depths in either percent or pixels.
- Separate multiple values with commas.
Limitations
The trigger can run only once per webpage. You cannot reset it manually. If a page is not scrollable, the trigger always fires. To avoid the trigger always firing, wrap the tag with the following code:
if ($(document).height() > $(window).height()) { /* your tag code */ }
Example trigger: track how long a visitor stays on a page
Example trigger: form submission error
Tags
Tags are code snippets that Google Tag Manager injects into your website and runs when a trigger condition occurs. For more information about the built-in tags available with Google Tag Manager, see Custom tags.
Tip
If you deployed the Predictive Engagement tracking snippet, you can invoke Journey JavaScript SDK methods from Google Tag Manager tags.Example tag: sign-up button
Suppress triggering a tag
To prevent a tag from triggering, use event.preventDefault() on a webpage element listener.
Debug
To run Google Tag Manager integration in debug mode, click Preview on your account page. Debug appears on the bottom right corner of each integrated page on your website.
Use the console to track all events on the webpage. You can see information such as which tags have or have not triggered, error messages, and values of the variables.