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
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 }).
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:
- Go to Settings → Goals in your dashboard.
- Click Add Goal.
- Select type Custom Event.
- Enter the event name exactly as you use it in your code (e.g.
Purchase). - 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:
product- Product namecategory- Product categorysku- Product SKU or IDplan- Subscription plan nameinterval- Billing interval (monthly, annual)coupon- Coupon or discount code used
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.
Tips
- Use consistent event names. Pick one name like
Purchaseand use it everywhere. Clickport is case-sensitive, soPurchaseandpurchaseare tracked as separate events. - Always use numbers for amounts. Pass
49.99, not'$49.99'. The currency symbol is determined by thecurrencyfield. - Track the final amount. Send the amount the customer actually paid (after discounts, taxes, etc.), not the list price.
- Add product properties. Even a single property like
productmakes revenue data much more useful. You can see which products generate the most revenue at a glance. - Test with a small amount. Before going live, fire a test event with a small amount and check the Sessions panel to verify the data appears correctly.