Use Google Tag Manager with Genesys Predictive Engagement

From Genesys Documentation
Jump to: navigation, search
This topic is part of the manual Event tracking with tag managers for version Current of Genesys Predictive Engagement.

Learn how to use Google Tag Manager to customize and deploy the Genesys Predictive Engagement tracking snippet.

About web messaging

Web messaging: Feature coming soon!
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 start tracking, configure Messenger and then use the Messenger JavaScript SDK to configure how you want to track web events.

Use Google Tag Manager

When you use Google Tag Manager to deploy the Genesys Predictive Engagement tracking snippet, 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 additional events that are specific to your webpage and business needs.

For more information about using Google Tag Manager, see Google's Tag Manager Help.

Deploy the 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.

In summary:

  1. In Google Tag Manager, create a new trigger and select DOM Ready as the type.
  2. Create a new tag and select Custom HTML for the type.
  3. Configure the tag to use the new DOM Ready trigger.
  4. In Genesys Predictive Engagement, copy the tracking snippet.
  5. In Google Tag Manager, paste the snippet in the new Custom HTML tag.
  6. Save your changes and publish your workspace.



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.

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.
The Enable this trigger on Window Load (gtm.load) option makes sense only when the whole content of the webpage loads.


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


This example shows how to define a trigger to track whether a webpage remains open for 3 seconds.

Example trigger: form submission error


The Element Visibility trigger fires when an element is shown on the page. It is useful to catch form submission errors (such as when a field validator error message appears.)



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.

Google Tag Manager treats JavaScript function calls as regular HTML, which results in errors. To avoid these types of errors, be sure to use triggers and tags as they are intended. Namely, use a trigger when you want to call a function.
You can invoke Journey JavaScript SDK methods from Google Tag Manager tags.

Example tag: sign-up button


This example shows a simple tag that triggers when the visitor clicks Sign up. It displays the form values in a modal window.

Suppress triggering a tag

To prevent a tag from triggering, use event.preventDefault() on a webpage element listener.



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 and haven't triggered, error messages, and values of the variables.