Goals
Track conversions to measure the success of your website and optimize your conversion rates.
Looking for multi-step user journeys? See the Conversion Funnels documentation.
Overview
Goals help you understand when visitors complete important actions on your website:
- Track Conversions - Purchases, signups, downloads, and more
- Measure Revenue - Assign values to goal completions
- Attribute Success - See which traffic sources drive conversions
Creating Goals
Method 1: Dashboard UI
Create goals directly in your Zenovay dashboard:
- Navigate to Analytics → Goals
- Click Create Goal
- Choose the goal type and configure matching rules
- Save and start tracking
Method 2: Code-Based Goals (Auto-Discovery)
Track goals directly in your code - they'll automatically appear in your dashboard:
// Track a goal by name (auto-creates if doesn't exist)
zenovay('goal', 'checkout_complete', {
value: 99.99,
currency: 'USD'
});
// Simple goal without value
zenovay('goal', 'newsletter_signup');
// Goal with custom properties
zenovay('goal', 'plan_upgrade', {
from_plan: 'free',
to_plan: 'pro',
value: 29
});Code-based goals are automatically discovered and shown in your dashboard with an "Auto-discovered" badge. You can edit them just like UI-created goals.
Goal Types
URL Match Goals
Trigger when visitors reach a specific page:
| Match Type | Example Pattern | Matches |
|---|---|---|
| Exact | /thank-you | Only /thank-you |
| Contains | checkout | /checkout, /checkout/confirm |
| Starts With | /blog/ | /blog/post-1, /blog/news |
| Ends With | /success | /payment/success, /signup/success |
| Regex | /order/\d+ | /order/123, /order/456 |
// These pages will trigger the goal when visited
{
goal_type: 'url_match',
url_pattern: '/checkout/success',
match_type: 'exact'
}Custom Event Goals
Trigger when a specific custom event is tracked:
// Track the event
zenovay('track', 'purchase', {
product_id: 'pro-plan',
value: 99.99
});
// Goal configuration (in dashboard)
{
goal_type: 'custom_event',
event_name: 'purchase'
}Element Click Goals
Trigger when visitors click specific elements:
// Goal configuration (in dashboard)
{
goal_type: 'element_click',
selector: '#signup-button', // CSS selector
// or
selector: '[data-track="cta-click"]'
}Element click goals require the Zenovay tracking script to be loaded. Make sure your script is installed correctly.
Goal Value Attribution
Assign monetary values to goals for revenue tracking:
// Dynamic value from transaction
zenovay('goal', 'purchase', {
value: orderTotal,
currency: 'USD'
});
// Fixed value per goal completion
// (Configure in dashboard: $10 per newsletter signup)React Integration
import { useEffect } from 'react';
function CheckoutComplete({ order }) {
useEffect(() => {
// Use the global zenovay object from the tracking script
if (window.zenovay) {
window.zenovay('goal', 'checkout_complete', {
order_id: order.id,
value: order.total,
items: order.items.length
});
}
}, []);
return <div>Thank you for your order!</div>;
}Best Practices
Goal Naming Conventions
Use descriptive, lowercase names with underscores:
| Good | Avoid |
|---|---|
checkout_complete | checkoutComplete |
newsletter_signup | Newsletter Signup |
plan_upgrade_pro | Plan Upgrade (Pro) |
Recommended Goals to Track
- Signup/Registration - New user conversions
- Login - Returning user engagement
- Purchase/Checkout - Revenue tracking
- Form Submissions - Lead generation
- Feature Usage - Product engagement
- Upgrade/Downgrade - Subscription changes
Debugging Goals
Check if goals are triggering correctly:
// Enable debug mode
zenovay('debug');
// Track a goal - will log to console
zenovay('goal', 'test_goal', { value: 10 });
// Check in browser console for:
// [Zenovay] Goal tracked: test_goal { value: 10 }API Reference
For programmatic goal management, see the Goals API.
curl -X GET "https://api.zenovay.com/api/external/v1/analytics/{websiteId}" \
-H "X-API-Key: zv_YOUR_API_KEY"