Enable DataLayer capture integration

Modified on Thu, 07 Mar 2024 at 10:42 AM

IMPORTANT!
DataLayer Capture integration is available to all enterprise customers, if you are interested in adding it to your account please contact our support team for more information at sales@cux.io


The data layer is an object used by Google Tag Manager to pass information to tags. It is a structured container of information on a webpage that helps track and send relevant data to various analytics and marketing tools, CUX included.


DataLayer Capture integration is a single-click solution to help you find visits that couldn’t be caught by regular CUX events. 


If you have GTM installed on your page, flick the switch in CUX to get started. When GTM integration is enabled, you can go to your recordings and find a specific visit or set a Goal or Waterfall step using GTM event names.

Enabling DataLayer capture integration

To enable the DataLayer Capture integration, log in to CUX and go to Integrations. Find the Google Tag Manager tile and enable the integration by toggling the switch to the right.


Everything works in an instant. If you have GTM on your page, our script becomes aware of it and collects information straight from the GTM dataLayer.

Watching visits that contain triggered GTM events


To watch a visit that contain a specific GTM event, go to Visits.

  1. Click Open filters.

  2. Scroll to find GTM event section in filters.

  3. Fill the Property and Value fields you want to use in your search.


Important When entering the Property, make sure to use the exact name that gets sent to GTM. Typically, you would enter an event name that you or your developers use in the JavaScript code of your site. You can naturally refer to the default GTM event names. In the Value field besides exact event values, you can also enter wildcards (asterisk symbol “*”) or regular expressions. In this way, you can match a wider number of object values and limit the number of conditions you use in your search.


  1. Click Apply.

  2. The visit list updates automatically showing all the visits that triggered a specific type of GTM event.

Setting a Goal or Waterfall step with GTM events

To set a Goal or Waterfall step using GTM events:


  1. Go to the Goals or Waterfalls tab.
  2. Select “Add New Goal” on Goals tab or click “Create new” button on Waterfalls tab.
  3. Name your Goal/Waterfall and (optionally) add a description.
  4. Click “Set-up Goal” or “Set-up Waterfall”.
  5. Select “Add Event”. This will launch the CUX event configurator.
  6. Select the “GTM event” options from the events list.
  7. Configure the event. Fill in the Key (also known as Property) and Value fields with specific GTM event values you want to track. In the Value field besides exact event values, you can also enter wildcards (asterisk symbol “*”) or regular expressions. In this way, you can match a wider number of object values and limit the number of conditions you use in your search.



  8. Save the step.
  9. When you're done with the settings, select “Create Goal” or “Create Waterfall”.

Goals or Waterfalls not only will filter for you visits that contain your GTM event but also will allow you to analyze them deeper

How to use GTM events in practice

Let’s say you have a new best-selling book in your online bookstore. You wanted to test new functionality on a highly visited page. You’ve just introduced video clips where book authors talk about their work. At the end of each clip, they reveal a promotional code that allows customers to order a signed copy. The functionality is up on your site for several days, yet the number of signed copies is way below your expectations. The website traffic indicates people watch videos. So what’s up?


For example, your promotional page pushes the following objects into the dataLayer:



You have an event with the property “event_action” which receives a value “watch to end” when the user watches the full video. So now it’s time to investigate what was the reason behind low sales. Log in to CUX, go to Visits, and open filters. Scroll to find GTM event. Enter the details of the GTM event and click “Apply”. Now the visit list is filtered, and you can watch the recordings to find out why things look the other way you expected. Is the promo code not audible? Is the video cropped wrongly? Maybe the promo code has a typo or something is wrong with applying a code to the content of users’ carts? Go through the list, hit Play, and see for yourself.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article