Dominion

DocsMeasure

Custom events and goals

Count signups, purchases and anything else, then make them goals.

Send an event

After the script has loaded, call:

dominion('signup')

Names are short and plain: signup, start_trial, Book a call. Up to 120 characters. pageview and engagement are reserved.

Add details

Pass a few short details as props. Never personal data: no names, emails or account numbers.

dominion('signup', { props: { plan: 'pro', from: 'pricing' } })

Add an amount

Put the amount in revenue, in normal units (48.00, not 4800). Without a currency it uses the site’s currency.

dominion('purchase', { revenue: 48.00 })
dominion('purchase', { revenue: [48.00, 'EUR'] })

For subscriptions, connecting Stripe is better: it knows about trials, renewals and cancellations.

Without writing code

Mark a button, link or form, and a click or submit sends the event:

<button data-dominion-event="signup">Sign up</button>

<!-- builders that only let you add classes -->
<a class="dominion-event-name=Book+a+call dominion-event-plan=pro" href="/book">Book a call</a>

Add data-outbound or data-downloads to the script tag to count clicks on links to other sites, or on files, without marking anything.

Before the page changes

When an event fires just before the page navigates away (a form that posts), pass a callback. It runs once the event is sent, or after a second at most.

form.addEventListener('submit', function (e) {
  e.preventDefault();
  dominion('signup', { callback: function () { form.submit(); } });
});

Before the script loads

Calls made before the script has loaded can wait in a queue. Put this line above the script tag:

<script>window.dominion = window.dominion || function () { (dominion.q = dominion.q || []).push(arguments) }</script>

Turn it into a goal

In your site, open Goals → Add a goal and pick the event by name, or a page:

Page patterns
PatternMatches
/thanksExactly that page
/blog/*One level: /blog/hello, not /blog/2026/hello
/shop/**Anything under /shop, at any depth

A goal that sums amounts shows revenue beside its conversions. Funnels chain two to eight goals or pages in order, within a visit or within a day.