First, you’ll need to install Capturly to Google Tag Manager. Let us guide you through an example of setting up a custom event. We will create an event for our “Get in touch” button on our pricing page.

  1. Open Google Tag Manager and create a new tag.
  1. Click on Tag Configuration and select “Custom HTML tag”.
  2. Define your tag by including the Capturly custom events script:
<script>
  trq('set',  'label',  'action',  'value');
</script>

In this example: 

<script>
  trq('set',  'get_in_touch',  'click',  'pricing');
</script>

  1. Click “Triggering” to initiate the trigger configuration.
  1. Press the “+” button to add a new trigger. Then, start the trigger configurations.
  2. Under the “Click” category, select “All Elements”.
  1. In “Trigger Configuration,” choose “Some clicks.”
    • Here, you can set conditions that will fire the trigger. By default, you can set up Page Host Name, Page Path, Page URL, and Referrer. If you don’t find the preferred option, select the “Choose built-in variables” option.
  1. Configure additional variables as a condition (if it’s needed)
    • You can customize and specify the conditions with built-in variables like click classes, click ID, form ID, and many more.

In this example: we defined the button based on the click class from the HTML code by adding a “contains” condition. Since click classes don’t have unique values in many cases, we also defined the URL where the button is placed.

Note: Please remember that between these conditions there is an AND condition, meaning the event will be triggered when ALL of these conditions are true. 

  1. Save.
  2. If you’d like to check everything was set up correctly, just click on the “Preview”.
  1. Type your website’s URL and click Connect. Your website will then open in Debug Mode.
  2. Click on the website element that was set up as an event.

Note: You can also set up custom events that are not triggered by clicks but by viewing, watching images, or videos.

  1. If it’s set up correctly, you will see that the event was fired in the Debug Panel.