Semust Metrik
Goals in Code
Define click and scroll goals with HTML attributes.
Add a data-semust-goal attribute to a button and Metrik records a goal conversion every time it is clicked. No JavaScript required.
Product page: Semust Metrik.
Consider Fast Goals first
If your conversion can be defined as reaching a particular page — a thank-you page, an order-complete page — define a Fast Goal instead and leave your site untouched. The method on this page is for interactions that happen without a page change.
Click goals
<button data-semust-goal="demo_request">Request a demo</button>The goal still fires when a child element is clicked (an icon, a span) — Metrik looks
up to the nearest ancestor. Elements added to the page later work with no extra step.
Adding properties to a goal
Any attribute starting with data-semust-goal- becomes a property of the goal:
<button data-semust-goal="plan_selected"
data-semust-goal-plan="pro"
data-semust-goal-billing="yearly">
Upgrade to Pro
</button>This records a plan_selected goal with plan and billing properties.
| Rule | Value |
|---|---|
| Goal name length | 64 characters maximum |
| Property value length | 255 characters maximum |
| Number of properties | Unlimited |
Use hyphens in attribute names
HTML lowercases attribute names, so data-semust-goal-planType arrives as
data-semust-goal-plantype. Write multi-word properties with hyphens instead:
data-semust-goal-plan-type. Hyphens become underscores in the property name, giving
you plan_type.
Scroll goals
To record a goal when an element scrolls into view, use data-semust-scroll:
<section data-semust-scroll="pricing_seen">
...
</section>
<section data-semust-scroll="faq_seen"
data-semust-scroll-threshold="0.75"
data-semust-scroll-delay="1000">
...
</section>| Attribute | Default | Description |
|---|---|---|
data-semust-scroll | — | Goal name, 64 characters maximum |
data-semust-scroll-threshold | 0.5 | How much of the element must be visible, between 0 and 1 |
data-semust-scroll-delay | 0 | Milliseconds it must stay visible before counting |
An invalid threshold (outside 0–1, or not a number) falls back to the default 0.5.
Each element counts once per page load; scrolling back up and down again does not create a second conversion.
Seeing goals in the dashboard
Your goals are listed by name in the Overview → Goals card, which also includes Fast Goals — both appear in one combined list.
Hover a goal in that card to see which traffic sources it came from.
Goals are not sent immediately
Click and scroll goals are queued and sent in a batch within a few seconds. When testing, allow a moment before expecting them in the dashboard.
