TrackingCustom events

Tracking

Custom events

Send events from your pages with odo() or a data attribute, with properties and revenue, and the events odo sends itself: outbound links, downloads, ad clicks.

On this page

Pageviews say where people went. Events say what they did: signed up, started a trial, added to cart.

From your code#

JavaScript
odo('Signup', { plan: 'Pro' })

The name is what goals and funnels match, up to 80 characters. Properties are optional, up to 30 of them, each kept as text up to 200 characters. Send what describes the action, never who did it: no names, emails or account ids.

A purchase is an event with revenue and a three-letter currency:

JavaScript
odo('Purchase', { revenue: 49, currency: 'USD' })

It counts as a sale traced to this visit, self-reported. When a payment platform odo reads traces the same sale (the same visitor and currency, about the same amount, within two hours), the platform’s replaces the page’s, so a sale never counts twice. More in trace each sale to its visit.

Calls made before the script loads wait for it: see the early snippet.

From your HTML#

Any element can send an event when it’s clicked, without code:

HTML
<button data-odo-event="Signup" data-odo-prop-plan="Pro">Start</button>

Each data-odo-prop-* attribute becomes a property.

Events odo sends itself#

EventWhenProperty
Outbound linkA click on a link to another siteurl, without its query
File downloadA click on a link to a file: PDF, ZIP, DMG, CSV, office documents, audio, video, APK and the likeurl
Ad clickA click on a link to one of your ad networks’ domainsurl

List your ad networks’ link domains in the website’s settings (Settings → Websites, its options). Clicks on links to them then count as Ad click rather than outbound links, past clicks too, so they can be goals and funnel steps.

From your server#

Something your server knows (a renewal, an account activated) can be sent with a project key, POST /api/v1/events. It joins the visitor’s visit. See the REST API.

What each event carried#

Tap an event in the Events card to see the properties it was sent with, and how often each value came up, for the range and filters on screen.

This page as markdownllms.txt