Last active
June 11, 2024 15:04
-
-
Save leo8nardo8/1cd422348b2f3144c2c44f287c021700 to your computer and use it in GitHub Desktop.
Clarity tag for events and parameters in GTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- | |
| !!! 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