Home > Knowledge Base > Install CUX code with Google Tag Manager

Install CUX code with Google Tag Manager

You can install the CUX code using Google Tag Manager (GTM). This is the least troublesome and the fastest method to see data in CUX. If your site already has the GTM code implemented, you can gather insights in minutes. Installation via GTM saves you the woes of navigating through the code or admin panel of your site. Once you create a CUX tag and publish your GTM settings, the CUX database starts filling with insights.

Before you start

  • You need a set up and configured Google Tag Manager. Create a container for the site you want to monitor with CUX.

Installing CUX code with GTM

  1. Sign in to Google Tag Manager.
  2. Select the account and container for the site you want to monitor with CUX.
  3. Go to Tags and click New.
  4. Enter a name for the tag — for example, CUX insights.
  5. Click Tag Configuration and select Custom HTML.
  6. Copy the CUX code from your account. Make sure you select the right project if you have more than one. For more information, see Where can I find the CUX code?
  7. Paste your CUX code in the HTML field.
  8. Setup a trigger. Select All pages to ensure the best insight into your visitor behavior. You can optionally add exceptions for pages that you don’t want to be monitored with CUX.
  9. Save your new GTM tag configuration.
  10. Use the GTM preview feature to see if the CUX code starts. 10.1. Click Preview in GTM. It will inform you that the preview mode is on. 10.2. Open your site in a new browser tab. 10.3. Once a page is loaded, GTM opens a panel in at the bottom of the browser window, where it shows all scripts that it triggered there. You should be able to see CUX on the list.
  11. Navigate to GTM and switch off the preview mode.
  12. Click Submit to publish the changes. That’s it! The tracking starts momentarily.
  13. Log in to CUX to verify if the code works. See Checking if the CUX code works.

Please note, we make sure to have this set of instructions as accurate as possible. It may happen that when Google redesign their tools, we may be slightly out of sync. It’s always best to check Google’s help for the most up-to-date description.

If you’re still unsure how to install a custom HTML code in GTM, see the official Google documentation.

Data layer integration

The easiest way to verify if CUX records visits on your site is to open several pages yourself. Load a page or two in your browser and go to the CUX dashboard. When the code operates and sends data to our database, you instantly see numbers on the dashboard.

Please note that this process won’t integrate your CUX project with Google Tag Manager events. It is, of course, possible you need to flick a single switch in the Integrations section. By default, the integration isn’t active. When you enable the integration, you’ll be able to search visits that triggered specific GTM events.

Next steps

  • Go to Visits. Start investigating the recordings as soon as they appear.
  • Go to Heatmaps. See user behavior. Understand what interests your users the most and see what catches their eye. For more information on heatmaps, see, What is a heatmap and what does it tell me?.
  • Enable GTM integration to start finding visits that trigger specific GTM events.

How to install the CUX code using GTM - tutorial