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.
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.
The clickport.track() function accepts three arguments: event name, properties (optional), and revenue (optional).
clickport.track('Purchase', null, {
amount: 49.99,
currency: 'USD'
});
clickport.track('Purchase', {
product: 'Pro Plan',
category: 'Subscription',
billing: 'annual'
}, {
amount: 299.00,
currency: 'USD'
});
// 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 });
amount (number, required) - The monetary value. Use decimal notation for cents: 49.99, not '$49.99'.currency (string, optional) - A three-letter ISO 4217 currency code. Defaults to 'USD' if not provided.null as the second argument: clickport.track('Purchase', null, { amount: 49.99 }).
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.
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.
The Goals API returns total_revenue for custom event goals. You can use this to build external dashboards, reports, or integrations.
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
});
Track new subscriptions with plan details:
clickport.track('Subscription', {
plan: 'Business',
interval: 'monthly'
}, {
amount: 79,
currency: 'USD'
});
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'
});
});
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'
});
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"]
}'
To see revenue data in your Goals panel, create a goal that matches your revenue event:
Purchase).Once the goal is created, revenue from matching events is automatically aggregated and displayed as total revenue for that goal.
The second argument to clickport.track() lets you attach up to 30 custom properties to each event. For ecommerce, useful properties include:
product - Product namecategory - Product categorysku - Product SKU or IDplan - Subscription plan nameinterval - Billing interval (monthly, annual)coupon - Coupon or discount code usedProperties 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.
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.
Purchase and use it everywhere. Clickport is case-sensitive, so Purchase and purchase are tracked as separate events.49.99, not '$49.99'. The currency symbol is determined by the currency field.product makes revenue data much more useful. You can see which products generate the most revenue at a glance.