Goal Tracking

Track user actions and conversions with flexible goal tracking

Overview
Goal tracking allows you to measure specific user actions and conversions on your website. Track button clicks, form submissions, purchases, and any custom events.

Goals can be tracked using HTML attributes (no JavaScript required) or the JavaScript SDK for programmatic control.

HTML Attribute Method
Track goals using the data-ed-goal attribute

Basic Goal Tracking

<button data-ed-goal="signup_clicked">Sign Up</button>
<a href="/pricing" data-ed-goal="pricing_viewed">View Pricing</a>

Goals with Parameters

<button 
  data-ed-goal="purchase_initiated"
  data-ed-goal-product-id="prod_123"
  data-ed-goal-amount="99.99"
  data-ed-goal-currency="USD"
>
  Buy Premium
</button>
JavaScript SDK Method
Track goals programmatically using the JavaScript SDK

Basic Goal Tracking

window.eventDash.track('signup_clicked', {
  buttonId: 'signup-button',
  page: 'homepage'
})

E-commerce Goals

window.eventDash.track('purchase_completed', {
  orderId: '12345',
  amount: 99.99,
  currency: 'USD',
  items: [
    { id: 'prod-1', name: 'Product 1', price: 49.99 },
    { id: 'prod-2', name: 'Product 2', price: 49.99 }
  ]
})
Best Practices

Use Descriptive Goal Names

Use clear, descriptive names like signup_clicked or purchase_completed instead of generic names.

Include Relevant Parameters

Add context with parameters like product IDs, amounts, or user segments to enable better analysis.

Track Key Conversion Points

Focus on tracking the most important user actions that indicate progress toward your business goals.