Track clicks from HTML
Record a custom event from a button, link, or form with data attributes.
Add HTML attributes to track an interaction without writing JavaScript.
-
Add
data-supermetry-eventto the clickable element.<buttontype="button"data-supermetry-event="Signup"data-supermetry-prop-plan="pro"data-supermetry-prop-location="header">Start free</button> -
Deploy the change and click the element once.
-
Open Events and select
Signup.
The full generated tracker also reads these attributes from submitted forms. Property names are the text after data-supermetry-prop-; they are stored only when identified collection is enabled.
What you should see: Signup appears under Events, with the two properties when identified collection is enabled.