The event trigger is used to track interactions that occur on your website that aren't handled by standard methods. The most common use is when you want to track form submissions, but the default behavior for the form has been altered (e.g. the submit browser event has been overridden.)
To create a new custom event trigger:
- Click Triggers > New.
- Click Trigger Configuration and choose the Event trigger type.
- Enter an event name.
- Enter a condition when the trigger should fire, like a page URL for example
- Click Save
Example configuration
Here is an example web configuration that will fire a tag when a custom event called 'button1-click' is pushed to the data layer:
- Add code that will push the event into the data layer when the button is clicked:
<a href="#" name="button1" onclick="window.clickflare.push( 'button1-click');">Button 1</a>
- Create a new custom event trigger. In the Trigger Configuration section of your new tag, use these settings:
This trigger fires on: Page URL, contains, /promo
When this trigger is applied to a tag, the tag will fire even when the default submit event is overridden. When the specified button is clicked, a custom event with the value of button1-click is pushed to the data layer. Tag Manager then detects button1-click as a custom event value, and will proceed to fire the tag.
Use window.clickflare.push()
to send multiple variables together with the event. For example: Send a conversion value with the custom event name:
window.clickflare.push({'button1-click','conversionValue':25});
Create the data layer variable in Tag Manager and use this variable in the conversion value field to report a conversion in ClickFlare.