Skip to content

Tracking

Custom events and revenue

Send signups, purchases and any action with props and revenue, from code or with HTML attributes.

Pageviews tell you where people go. Events tell you what they did: a signup, a purchase, a plan toggle, a video play. Every event shows up in the live feed the moment it’s sent, in the Events report, and in goals and funnels.

Send an event

globatics('event', 'signup', { plan: 'free', source: 'pricing' });

// or the method form
globatics.track('video_play', { video: 'launch-film', seconds: 42 });

Props are flat key–value pairs. Break any event down by a prop in the Events report, or use it in a filter.

Revenue

Pass a fourth argument with revenue (major units) and currency (ISO 4217). Revenue appears live on the globe as a burst with an arc to your home location, in the running total of the Live view, and in the Revenue report by channel, source, campaign, country, page and AI assistant.

globatics('event', 'purchase', { plan: 'pro', items: 2 }, { revenue: 149.0, currency: 'USD' });

// a refund
globatics('event', 'refund', { order: 'A-1042' }, { revenue: -49.0, currency: 'USD' });

Revenue in another currency than the site’s is kept and listed separately rather than mixed into totals. Change the site currency in Settings.

No-code events

Tag any element with data-glb-event. Each data-glb-prop-* attribute becomes a prop. Forms fire on submit.

HTML
<button data-glb-event="add_to_cart" data-glb-prop-product="kettle"
        data-glb-revenue="89" data-glb-currency="USD">
  Add to cart
</button>

<form data-glb-event="newsletter_signup">…</form>

From your server

Payments confirmed by a webhook are best sent from the browser’s success page, where the visitor’s session is known. If you can only send from a server, post the same payload the tracker sends to /api/collect with the visitor’s user agent and the page they were on.

Terminal
curl -X POST https://globatics.live/api/collect \
  -H "Content-Type: text/plain" \
  -H "User-Agent: Mozilla/5.0 (…the visitor's browser…)" \
  -H "X-Forwarded-For: 203.0.113.7" \
  -d '{"v":1,"s":"SITE_ID","t":"event","u":"https://example.com/checkout/success","pid":"srv-1042","n":"purchase","rev":149,"cur":"USD"}'

The forwarded IP is used for the location and the daily visitor hash, then discarded. When the same IP and user agent visited the page, the event joins that visitor’s session. If your Globatics server sits behind a proxy, read which headers it trusts.

Naming and limits

  • Use snake_case names that describe what happened: signup, plan_toggle, invite_sent.
  • Names starting with $ are reserved for automatic events ($outbound, $rage_click…).
  • At most 30 props per event; string values up to 256 characters. Never send passwords, tokens or personal data in props.
  • Turn an event into a conversion with a goal.