How to send search data to Google Tag Manager

Enable the integration in MyCludo

  1. In the navigation, select Configuration › Data settings
  2. Enable the Send data to Google Tag Manager toggle
  3. Click the Save button
An engine with the Google Analytics integration enabled.

Using events within Google Tag Manager

To create a variable:

  1. Log into your Google Tag Manager container
  2. In the left menu, select the Variables option
  3. Under User-Defined Variables, click the New button
  4. Type a descriptive name for the variable in the Untitled Variable field
  5. Under Variable Configuration, Click Choose a Variable type to begin setup….
    • Under Page Variables, select Data Layer Variable
    • Enter the variable name in the Data Layer Variable Name field
    • Ensure the Data Layer Versions drop down is set to Version 2
    • Click the Save button
  6. To publish your changes, click on Submit in the top right

Using events to create “triggers”

Triggers can be set up so that certain Google Tag Manager tags will do a specific task when specific conditions are met. Cludo events can be used to define these specific conditions. For example, I could set up a trigger that tells my Google Analytics tag to send a product_search_result_clicked event when a Cludo click event occurs and the clicked URL contains ‘/products’ (remember, to access the clickedUrl, you first need to map it to a variable).

To create a trigger:

  1. Log into your Google Tag Manager container
  2. In the left menu, select the Triggers option
  3. Under Triggers, click the New button
    • Type a descriptive name for the trigger in the Untitled Trigger field
    • Under Trigger Configuration, Click Choose a Trigger type to begin setup….
    • Under Other, select Custom Event
    • Enter “cludo_search_event” or “cludo_click_event” in the Event name field
    • Under This trigger fires on:
      • Leave All Custom Events set if you want the trigger to fire every time this event occurs
      • Or, set this to Some Custom Events to add more conditions that need to be met for the trigger to fire. In our example, we wanted to also add the condition that the clicked search result URL contains “/products”
    • Click the Save button
  4. To publish your changes, click on Submit in the top right

That’s the hard part! Now that you’ve created variables and triggers using Cludo event data, you can use them in all kinds of ways with your GTM tags. Check out Google’s official Google Tag Manager documentation for more information.