Events
The Events screen shows the events your site sends on purpose: whether each one is still firing, how often, from how many visitors, and from which pages.
Send an event
Once the Silktide analytics snippet is on a page, call silktide with a name wherever the thing you care about happens: a form sent, a video played, a sign-up.
document.querySelector("#newsletter-form").addEventListener("submit", () => {
silktide("newsletter_signup");
});
The snippet defines silktide before the analytics script has loaded, so an event sent early is queued and recorded once the script is ready.
Choose a name that stays the same for as long as you track the event, such as newsletter_signup or video_played. The name is what filters, exports, goals, and the API use. Keep personal data out of it: never put an email address, a person's name, or an account number in an event name.
The analytics script already records some events itself under these names, so give yours a different one: page_load, page_update, page_return, click, download, frustration, and field.
Send detail with an event
Pass an object as a second argument to say more about what happened: which accordion was opened, which form was sent, which video was played. Each key in it is a property of the event.
document.querySelectorAll("details").forEach((accordion) => {
accordion.addEventListener("toggle", () => {
if (accordion.open) {
silktide("open_accordion", {
summary: accordion.querySelector("summary")?.textContent.trim() ?? "",
});
}
});
});
- Every value is recorded as text. Send text, numbers, or true and false; an object or a list inside a property is not recorded in a useful form.
- You do not need to send the page's address. Every event already records the page it was sent from.
- Keep a property's name the same for as long as you track it, and keep personal data out of the values, just as you would out of the event's name.
event,time, andpageUrlare used by the script itself, so they are not recorded as properties.
What the screen shows
- Your events are the four busiest events of the period, as cards. Each shows how often the event was sent, how many visitors sent it, how many times per visitor, its shape over the period, and when it was last seen. With Compare on, the count shows its change against the previous period.
- The dot beside Last seen turns amber once an event has not been sent for more than three days. An event that has gone quiet may have been removed from the site by accident.
- Looks like a test marks an event sent three times or fewer by a single visitor, which is usually someone trying it out.
- Where it fires lists the pages an event was sent from, most often first. Pick another event to see its pages, or open the journeys that include it.
- Recorded automatically lists the events the script records itself. Each links to the screen that covers it: page loads to Pages, clicks to Clicks, frustration to Frustration, and downloads to Downloads.
- The table lists every event your site sends, with when each was first and last seen. Open a row for that event's details, or use its menu to see its journeys or filter every screen to it.
People who can administer Analytics can give an event a readable name from the table. The name applies across your account; filters and exports keep using the name your site sends.
An event's details
Open an event from the table to see it on its own: how often it was sent over the period, the journeys through it, and where its visitors came from. For an event sent with properties, the details also show:
- What it was sent with ranks the values of one property, most sent first, with the number of times each was sent. Choose another property from the menu above the list. Pick a value to list only the times the event was sent with it, and pick it again to list every time.
- Every time it was sent lists each time the event was sent, newest first: when, from which page, and each property in a column of its own. Search it for a page or a value, or open a row to see the visit it was part of.
Get event detail through the API
The Silktide REST API gives you the same detail, so you can report on it in your own tools. Each endpoint takes the event's name as event, along with the date range and filters every analytics endpoint takes:
analytics/event-propertieslists the properties the event was sent with.analytics/event-property-valuesranks one property's values. Name the property asproperty.analytics/event-occurrenceslists every time the event was sent, newest first. Each row has thetime(a Unix timestamp, in seconds), the page asurl, the visit it was part of assessionId, and itsproperties. Addpropertyandvalueto list only the times it was sent with that value.
Create a key on the API screen; full request shapes are in the developer documentation.
Use events in goals
A goal can be completed when a visitor triggers an event. See Funnels and goals.
If an event does not appear
Check that the analytics snippet is on the page that sends the event, that the code calling silktide runs, and that the date range you picked includes today.