GTM events

Forward Unless experience events to your GTM account.

my imageSome great alternative text


You can measure the success of your experiences using the Unless Insights while keeping an eye on the goals you've set and the audiences you are building.

However, if you want to dig deeper or simply prefer using other tools like Google Analytics or Mixpanel as your single source of truth, this integration is for you.

How does it work?

With this integration, we'll send event data about shown experiences to your GTM account. From GTM you can forward these events to your favorite tools like Google Analytics and Mixpanel.

Install instructions

Simply toggle the switch to activate it and we'll start sending data to the GTM account associated with your website - no need for additional setup.

Once the integration is activated we will automatically start sending events to GTM through the data-layer. The event is structured as follows:

We'll send one event for each experience applied to the page:

  • event: 'unless_experiences'
  • action: 'My experience' // experience name
  • label: 'Control' or 'Participant' or the variantion name if applicable.

Additional instructions:

  • To use this you have to create variables in your GTM setup. Create a variable in GTM and choose ‘data layer variable’. As the data layer variable name you set "action" and for the Variable name (on top) you can use something like "Unless experience name". After that, do the same for a new variable but set the variable name to "label" and call it "Unless group" (the value of this will be either “Participant” or “Control”).
  • Secondly, create a trigger. When creating a new trigger, choose ‘custom event’ and set the event name to "Unless". Call the trigger something like "Unless experience trigger".
  • Finally, you can create the tag. In the tag, choose the trigger you created earlier. Then, choose "custom HTML" as the tag type. To test if it works you can use the follow code as the value:
  console.log('unless experience event triggered', 
              {{Unless experience name}}, {{Unless group}})

Note, this will simply print the values to the browser's development console. Instead of this, you’d want to send them to a different tool like Mixpanel using the Mixpanel JS API.

Related content

Frequently asked questions

Simply toggle the switch to activate the Google Analytics integration and we'll start sending data to the Google Analytics account associated with your website - no need for additional setup.

my imageSome great alternative text

Friendly support from real people

We’re here to help

We are known for our quick responses if you have an issue. Feel free to ask us anything. But you can also ask our conversational AI a question, of course!