Use Google Tag Manager with Altocloud

From Genesys Documentation
Jump to: navigation, search
This topic is part of the manual Event tracking for version Current of Altocloud.

Learn how to use Google Tag Manager (GTM) to customize and deploy the Altocloud tracking snippet.

Use Google Tag Manager

When you use GTM to deploy the Altocloud tracking snippet, Altocloud always tracks standard customer journey events including pageviews and form entries. You can also use GTM's prebuilt tags, triggers, variables, to track additional events that are specific to your webpage and business needs.

For complete information on how to use Google Tag Manager, see Google's Tag Manager Help.

Deploy the tracking snippet with GTM

This video shows you how to use Google Tag Manager to deploy the Altocloud tracking snippet on your website. In summary:

  1. In Google Tag Manager, create a new trigger. For the type, select DOM Ready.
  2. Create a new tag. For the type, select Custom HTML. Configure the tag to use the new DOM Ready trigger.
  3. In Altocloud, and copy the tracking snippet.
  4. In Google Tag Manager, paste the snippet in the new Custom HTML tag.
  5. 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. Additionally, you can create your own trigger.

This example shows the Form Submission trigger, which launches when the user clicks the Sign up button 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. In the same way, you can track field-related error messages.

Example trigger: track when a user 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 you specify
  • Specify the vertical and horizontal scroll depths in either percents or pixels.
  • Separate multiple values with commas.
Note that the Enable this trigger on Window Load (gtm.load) option makes sense only when the whole content of the webpage loads.


The trigger can be executed only once per webpage. It cannot be manually reset. If a page is not scrollable, the trigger always fires. To avoid that, wrap the tag with the following code:

if ($(document).height() > $(window).height()) { /* your tag code */ }

Example trigger: track how long a user stays on a page


This example shows how to define a trigger to track if 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 can be useful to catch form submission errors (such as when a field validator error message appears.)



Tags are code snippets which Google Tag Manager injects into your website and runs when a trigger condition occurs. For complete information on the built-in tags that are 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 user clicks the Sign up button. It displays information from the fields 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.

The Debug button appears on the bottom right corner on each of the integrated pages of your website.

Use the console to track all events on the webpage. You can see which tags have been triggered and which have not, error messages, values of the variables, and more.