Clickport
Start free trial

Ecommerce Revenue Tracking

You can attach monetary values to any custom event in Clickport. This lets you track purchases, subscriptions, donations, or any action with a dollar amount and see which traffic sources, campaigns, and pages drive the most revenue for your business.

How it works

Revenue tracking uses the same custom events system you already have. When you call clickport.track(), you pass a third argument with the amount and currency. Clickport stores the revenue alongside the event and aggregates it in your Goals panel.

There is nothing to enable or configure. If you send revenue data, it shows up automatically.

Send revenue data

The clickport.track() function accepts three arguments: event name, properties (optional), and revenue (optional).

Basic purchase

clickport.track('Purchase', null, {
  amount: 49.99,
  currency: 'USD'
});

Purchase with product details

clickport.track('Purchase', {
  product: 'Pro Plan',
  category: 'Subscription',
  billing: 'annual'
}, {
  amount: 299.00,
  currency: 'USD'
});

Different currencies

// Euros
clickport.track('Purchase', null, { amount: 39.99, currency: 'EUR' });

// British pounds
clickport.track('Purchase', null, { amount: 34.99, currency: 'GBP' });

// Default currency (USD) when omitted
clickport.track('Donation', null, { amount: 25 });

Revenue fields

Properties are optional. If you only need to track revenue without product details, pass null as the second argument: clickport.track('Purchase', null, { amount: 49.99 }).

Where revenue appears

Goals panel

When you create a custom event goal that matches your revenue event (e.g. a goal for the "Purchase" event), the Goals panel shows the total revenue aggregated across all matching events. This lets you see at a glance how much revenue each goal is generating.

Session timeline

Revenue events appear in individual session timelines in the Sessions panel. You can expand any session to see the purchase event with its properties and revenue data.

API

The Goals API returns total_revenue for custom event goals. You can use this to build external dashboards, reports, or integrations.

Common setups

After a checkout

Fire the event on your order confirmation or thank-you page:

// On your order confirmation page
clickport.track('Purchase', {
  product: order.productName,
  plan: order.planType
}, {
  amount: order.total,
  currency: order.currency
});

SaaS subscription

Track new subscriptions with plan details:

clickport.track('Subscription', {
  plan: 'Business',
  interval: 'monthly'
}, {
  amount: 79,
  currency: 'USD'
});

Donation

Track donations with variable amounts:

document.getElementById('donate-btn').addEventListener('click', function() {
  var amount = parseFloat(document.getElementById('amount').value);
  clickport.track('Donation', null, {
    amount: amount,
    currency: 'USD'
  });
});

Add to cart

Track cart additions to measure purchase intent, even before checkout:

clickport.track('Add to Cart', {
  product: 'Running Shoes',
  sku: 'RS-2026-BLK'
}, {
  amount: 129.95,
  currency: 'EUR'
});

Server-side tracking

You can also send revenue events from your server using the Events API. This is useful when the purchase is confirmed server-side (webhook from a payment processor, for example) rather than in the browser:

curl -X POST https://clickport.io/api/event \
  -H "x-api-key: ck_your_key" \
  -H "Content-Type: application/json" \
  -H "User-Agent: Mozilla/5.0 ..." \
  -d '{
    "type": "custom",
    "name": "Purchase",
    "url": "https://yoursite.com/checkout/complete",
    "revenue_amount": 49.99,
    "revenue_currency": "USD",
    "meta_keys": ["product", "plan"],
    "meta_values": ["Pro Plan", "annual"]
  }'

Set up a goal for revenue events

To see revenue data in your Goals panel, create a goal that matches your revenue event:

  1. Go to Settings → Goals in your dashboard.
  2. Click Add Goal.
  3. Select type Custom Event.
  4. Enter the event name exactly as you use it in your code (e.g. Purchase).
  5. Save the goal.

Once the goal is created, revenue from matching events is automatically aggregated and displayed as total revenue for that goal.

Use properties for richer data

The second argument to clickport.track() lets you attach up to 30 custom properties to each event. For ecommerce, useful properties include:

Properties appear as expandable rows in the custom events section of your dashboard, letting you break down revenue by product, plan, or any other dimension. See the Custom Events docs for more on properties.

Attribution

Clickport uses first-touch attribution per session. When a visitor arrives via a UTM-tagged link or a referral source and later completes a purchase, the revenue is attributed to the original traffic source for that session.

You can use the dashboard's cross-filtering to see revenue broken down by source, campaign, country, device, or any other dimension. Apply a goal filter to narrow the entire dashboard to sessions that completed a purchase.

Payment processor referrals. If a visitor leaves your site to complete payment on an external processor and returns, the return visit may start a new session with the payment processor as the referrer. To avoid this, make sure your thank-you page fires the revenue event. The event is attached to the session that loaded the confirmation page.

Tips