Skip to content
Tracking and technical

What is a custom event in analytics?

3 min read · Updated · By the Reveata team

Short answerA custom event is an action you define and send to your analytics tool yourself, such as signup, start_trial or download_pdf, so it can be counted, compared by traffic source and used as a goal or funnel step.

Person typing on black keyboard
Photo by Luis Villafranca on Unsplash

Page views tell you where people went. Custom events tell you what they did there. Clicking "Create account", finishing a checkout, playing a demo video or copying an install command are all actions a page view cannot capture on its own.

Different tools use different words for the same idea: events, custom events, conversions or goals. In Reveata they are called goals.

Sending a custom event

There are three common ways:

  1. From JavaScript, when the action happens in your code:

    js
    reveata('goal', 'signup');
    reveata('goal', 'checkout', { plan: 'pro', billing: 'yearly' });
  2. From HTML, without writing JavaScript. In Reveata, any element with data-reveata-goal records a goal when clicked, and a form with it records the goal when submitted:

    html
    <button data-reveata-goal="signup">Create account</button>
  3. From your server, once the action is confirmed, for example with reveata events send and the visitor id from the browser (send goals from your server).

A tag manager can send them too, using the Reveata Analytics template's Track a goal tag (Google Tag Manager).

Naming custom events

Names become the labels in every report, so choose them once and keep them stable.

  • Use verbs or outcomes: signup, start_trial, invite_sent.
  • Group related events with a prefix: checkout:started, checkout:paid. Reveata allows : for namespaces.
  • Keep variants in properties, not names: one signup event with a plan property is easier to read than signup_pro and signup_free. See event properties.

In Reveata, goal names are lowercase letters, digits, _, - and :, up to 64 characters. Other characters become _, so Sign Up becomes sign_up. Names starting with billing: are reserved for the built-in subscription goals (Custom goals).

Events you may not need to build

Some actions are recorded without code. Reveata's script records scroll depth, time on page and outbound link clicks by default, and an opt-in extras script records broken links (404), file downloads and form submissions. Connected payment providers add subscription goals such as trial started, paid, renewed and cancelled.

Using custom events

  • Goals by source. See which channels and campaigns lead to sign-ups, not just visits.
  • Funnels. Line up pages and goals in order and see where people drop off (Funnels).
  • Filters. Keep only visits that completed a goal, or did not.
  • Alerts and webhooks. Get told when a goal is completed.

Pitfalls

  • Counting clicks instead of outcomes. A click on "Buy" is not a purchase. Send the confirmed action from the server or the confirmation page.
  • Firing before the script loads. Calls made too early are lost unless you add the queue snippet from Install the script.
  • Too many events. Track the actions you will make decisions with. Each one also counts towards your plan's monthly events.
  • Personal data in names. Never put emails or names in event names or properties.

Frequently asked questions

What is the difference between a custom event and a goal?

Many tools treat a goal as a custom event you have marked as important. Reveata calls every custom event a goal, and lets you star one goal as your website's #1 KPI.

Do custom events count towards my Reveata plan?

Yes. Every page view and custom event collected from your websites or sent by your server counts as one event. Payment records, bot traffic and imported history do not. See pricing for each plan's allowance.

Can I send a custom event without a visit?

A goal is credited to the visit it belongs to, and only a page view starts a visit. From the server, pass the visitor id so the goal can be linked to the visit that led to it.

See it with your own numbersReveata ties every visit and sale to the source that brought it. Add your website in a minute.
Get started
Was this page useful?
GlossaryWhat are event properties?Event properties are key–value details attached to an analytics event, such as the plan chosen or the button clicked on a signup event, so you can break one event down by those details instead of creating a separate event for every variation.GlossaryWhat is a data layer?A data layer is a JavaScript object on your web pages, most often Google Tag Manager's window.dataLayer array, that holds structured details about the page and what the visitor does, so tags can read clean values instead of scraping them from the page.GlossaryWhat is server-side tracking?Server-side tracking means your backend, not the visitor's browser, sends events such as sign-ups, payments or page requests to your analytics tool, so they are recorded even when a script is blocked or never runs.GlossaryWhat are Core Web Vitals?Core Web Vitals are three measurements Google uses to describe a page's real-world user experience, namely Largest Contentful Paint (loading), Interaction to Next Paint (responsiveness) and Cumulative Layout Shift (visual stability).GlossaryWhat is a canonical URL?A canonical URL is the one preferred address you want search engines to index and show for a page whose content is reachable at several URLs, usually declared with a rel="canonical" link in the page's head.GlossaryWhat is a Content Security Policy (CSP)?A Content Security Policy (CSP) is a set of rules a website sends to the browser, usually in a Content-Security-Policy header, listing which sources of scripts, styles, images and network connections the page is allowed to use, so injected or unexpected code is blocked.