Events

Report sign-ups, purchases and other actions with sd() or a data-sd-event attribute.

An Event is a named action on your website, with optional properties. Events show on the dashboard's Events card, where each one opens into a breakdown by property, and they can be Goals and Funnel steps.

From your code: sd()

Call sd(name, props) once the snippet has loaded:

sd("Signup");
sd("Purchase", { plan: "pro", amount: 49 });
  • name is up to 200 characters. Calls without a name are ignored.
  • props is an optional object of small values: strings, numbers or booleans. Keep it to the few properties you want to break the Event down by.
  • The current page's path is sent with the Event, so the Events card can show where it happened.

To call sd() before the script has loaded, add the stub from Frameworks.

Never put personal data, such as emails or names, in an Event's name or properties. Properties are stored as you send them and shown to everyone with access to the Site.

Without code: data-sd-event

Add data-sd-event to any element, and each click on it, or on anything inside it, sends an Event with that name. Attributes starting with data-sd-prop- become its properties:

<button data-sd-event="Download" data-sd-prop-file="pricing.pdf">Download the price list</button>

<a href="/signup" data-sd-event="Signup click" data-sd-prop-position="hero">Start free</a>

The first sends Download with { "file": "pricing.pdf" }. Property values from attributes are always strings.

Captured automatically

These need no code at all:

EventSent when someone
Phone clickclicks a tel: link
Email clickclicks a mailto: link
WhatsApp clickclicks a link to wa.me or api.whatsapp.com
Form submitsubmits any form

A contact link that also has data-sd-event sends only the marked Event, not both.

Clicks on links to other domains are recorded as Outbound links, not Events. They have their own report on the Links tab, with the page each click came from.

Events need a Visit

An Event belongs to the Visit it happened in, so it is stored only after that Visitor's first Pageview. An Event sent before any Pageview, such as from a server, is dropped. An Event fired in the very same moment as the page's first Pageview can occasionally be dropped for the same reason.

Goals and Funnels

In the Site's Settings → Attribution, any Event name can become a Goal, and the automatic Events above are one click away as Quick add chips. A Goal reports its conversions, its unique Visitors and the conversion rate. Funnels take Events as steps too, next to page patterns.