Saltar al contenido principal
4 min de lectura

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:

  1. Navigate to Analytics → Goals
  2. Click Create Goal
  3. Choose the goal type and configure matching rules
  4. Save and start tracking

Method 2: Code-Based Goals (Auto-Discovery)

Track goals directly in your code - they'll automatically appear in your dashboard:

Code-Based Goal TrackingJavaScript
// 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 TypeExample PatternMatches
Exact/thank-youOnly /thank-you
Containscheckout/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
URL Match ConfigurationJavaScript
// 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:

Custom Event GoalJavaScript
// 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:

Element Click GoalJavaScript
// 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:

Goal with RevenueJavaScript
// 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

React Goal TrackingJavaScript
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:

GoodAvoid
checkout_completecheckoutComplete
newsletter_signupNewsletter Signup
plan_upgrade_proPlan Upgrade (Pro)
  • 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:

Debug ModeJavaScript
// 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.

Get Analytics via External APIBash
curl -X GET "https://api.zenovay.com/api/external/v1/analytics/{websiteId}" \
-H "X-API-Key: zv_YOUR_API_KEY"
¿Fue útil esta página?