DocsMeasure

Custom events and goals

Count signups, purchases and button clicks with datacenter() custom events, then turn events and pages into goals you can see in the dashboard.

On this page

Pageviews tell you who came. Events and goals tell you who did something.

Send a custom event

Once the script is on the page, call datacenter with an event name.

JavaScript
datacenter('Signup');

You can add details as props. Keep values short: plain strings or numbers.

JavaScript
datacenter('Purchase', { plan: 'Pro', value: 49, currency: 'USD' });

Events from the browser count toward your monthly allowance like pageviews. Automatic events, such as outbound link clicks and file downloads, are free and need no code.

The script loads with defer, so call datacenter from code that runs after the page has loaded, such as a click handler or a form's submit handler.

Make a goal

A goal is something you want to count as a win, like a sale or a signup. Open the site, then Goals. The common goals take one tap and no code:

GoalCountsWhat it needs
Someone buysEach paid order (the Purchase event)Stripe or Shopify connected, the Events API, or datacenter('Purchase')
Someone fills in a formEach form sent with an email or phone field (the Form sent event)90-day tracking. Adding the goal turns on form capture
Someone books or callsTaps on your phone number, email address and booking links such as Calendly and Cal.com (the Book or call event)90-day tracking. Adding the goal turns on tap counting
Someone reaches a thank-you pageVisits to the page people see after they buy or sign upNothing. Pick the page from your own pages, or type it

Form sent and Book or call come from a small add-on that the 90-day tag loads only while its switch is on. Like the rest of 90-day tracking, it sends nothing until the visitor agrees when Wait for consent is on. Booking links count when a visitor taps a link or button that opens them. A booking made inside an embedded Calendly widget counts too.

Custom goals

Under Custom goal there are two kinds.

KindCounts when
A page is visitedA visitor opens a matching path, such as /thanks. Use * for any part, like /blog/*
An action happensAn event with this name arrives, such as Signup

A site can have up to 20 goals, and your plan may allow fewer. A new goal counts past visits too.

Edit, archive or give a goal a value

  • Edit changes a goal's name and what it matches. Past visits are counted again with the new rule.
  • Value per conversion is optional: what one conversion is worth to you, in a currency you pick. The Goals card then shows what each goal brought in and a total.
  • Archive takes a goal off your dashboard and reports and frees its place on your plan. Its rule stays, so Restore brings it back with its history. Archived goals can be deleted for good.

See goals in the dashboard

Each goal shows its conversions and its conversion rate: the share of visitors who reached it. Filter by source, campaign or short link to see which one brought the people who converted.

Send a goal to Meta

On the site's Integrations page (under Settings), tick a goal under Goals to send and its conversions go to the Meta Conversions API, from the browser and from your server. See Meta Conversions API.

Events from your server

Some events only your server knows about, like a paid order. Send those with the Events API.

Something missing or wrong? Email hello@datacenter.so.