Skip to content

Instantly share code, notes, and snippets.

@leo8nardo8
Last active June 11, 2024 15:04
Show Gist options
  • Select an option

  • Save leo8nardo8/1cd422348b2f3144c2c44f287c021700 to your computer and use it in GitHub Desktop.

Select an option

Save leo8nardo8/1cd422348b2f3144c2c44f287c021700 to your computer and use it in GitHub Desktop.
Clarity tag for events and parameters in GTM
<!--
!!! Clarity global tag must trigger before this APIs calls.
> Use case example: Send 'purchase' event with 'coupon' parameter.
Documentation for events: https://learn.microsoft.com/en-us/clarity/setup-and-installation/clarity-api#add-custom-events
Documentation for custom tags: https://learn.microsoft.com/en-us/clarity/setup-and-installation/clarity-api#add-custom-tags
-->
<script>
window.clarity("event", "<event_name>"); // Replace <event_name> for the desired event
window.clarity("set", "<parameter>", "{{parameter}}"); // Replace <parameter> and var {{parameter}} for the appropriate information
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment