Goal Tracking
Measure button clicks, form submits, and other conversions. Goals work best as funnel steps.
Use trackGoal for goals
Prefer
data-ed-goal or trackGoal(). Calling track() creates a custom event (Standard+), not a goal.HTML attributes
After the tracker script is installed — see HTML attributes
html
<button data-ed-goal="signup_clicked">Sign Up</button>
<button
data-ed-goal="purchase_initiated"
data-ed-goal-product-id="prod_123"
data-ed-goal-amount="99.99"
>
Buy Premium
</button>JavaScript SDK
Programmatic goals
javascript
window.eventDash.trackGoal('signup_clicked', {
buttonId: 'signup-button',
page: 'homepage'
})
window.eventDash.trackGoal('purchase_completed', {
orderId: '12345',
amount: 99.99,
currency: 'USD'
})Best practices
Use clear names like signup_clicked.
Add parameters that help you segment later (plan, amount, CTA location).
For auth flows, track the CTA click with signup_clicked and fire trackGoal('signed_in') after a successful login on the server or client callback.
Wire important goals into funnels in the dashboard. Store checkouts should use the ecommerce goal names.