Custom goals and data attributes
Record named goals from code or HTML and give important elements stable names for funnels.
Updated
Boostra records pageviews, clicks, form starts and submits on its own. Goals and data attributes let you name the moments that matter, so they show up clearly in Events and can be used as funnel steps.
Send a goal from code#
window.boostra?.("goal", "signup_completed");A goal name must start with a letter and can contain letters, digits and _ . : -, up to 80 characters. The call returns false when the name does not match. Use stable, lowercase names such as trial_started or demo_booked, and never put user data in them.
Send a goal from HTML#
Add data-boostra-goal to a link or button, and a click on it fires that goal:
<a href="/book" data-boostra-goal="demo_booked">Book a demo</a>Name a button or link#
Give controls that matter a stable name, so a funnel step keeps working after you change the copy or the design:
<button data-boostra-action="start_trial" data-boostra-action-label="Start free trial">Try it free</button>data-boostra-action: a lowercase snake_case name that never changes with the copy.data-boostra-action-label: the readable label shown in Boostra.
Keep elements out of tracking#
data-boostra-ignore: the element and its contents are not tracked.data-boostra-mask: the element's content is treated as private and masked wherever Boostra captures page content.
Attributes on the snippet itself#
A few settings go on the <script> tag rather than on elements:
data-frustration="false"turns off rage-click and dead-click detection;data-frustration-samplesets the share of sessions checked (default0.5).data-allow-localhost="true"lets you test onlocalhost, which is skipped otherwise.data-shopify-goals="false"turns off the automaticadd_to_cartandcheckout_startedgoals on Shopify.data-consent-required,data-respect-dntanddata-cross-domainare covered in consent and cross-domain tracking.
Goals appear in Live Events within seconds. Open Live Events to confirm a new goal fires before you build a funnel on it.
Related articles
-
The window.boostra JavaScript API
Every command the tracking snippet exposes on window.boostra, with signatures and examples.
Read article -
Events and actions
Review the clicks, forms and other actions Boostra detects on your site, name them and use them in funnels.
Read article -
Create a funnel
Build a funnel from a template, a suggestion, the funnel agent or your own steps, and manage it from the Dashboard card.
Read article -
What Boostra tracks automatically
The pageviews, clicks, forms, scrolls and frustration signals the tracker records without any extra code.
Read article