Skip to content
Start free trial
BlogEvent tracking

Website event tracking: a practical guide

Pageviews tell you people arrived. Events tell you what they did next. Here’s how to plan, name, send and check the events that answer your real questions.

Say you run marketing for a small SaaS product and have never set up website event tracking. Last month the site had 12,000 visits, and the pricing page sits in your top five. Then the founder asks two questions: how many visitors started a trial, and which channel sent the ones who paid?

Your pageview report can’t answer either. It knows people arrived. It has no idea what they did next.

Website event tracking fills that gap. It records the actions people take on your site (a sign-up, a download, a purchase) as named events you can count, compare and turn into goals.

By the end of this guide you’ll know which events arrive on their own, how to plan and name the few you add, three ways to send them, and how to check that each one fires exactly once. The examples use FunnelSights, a cookieless analytics tool, because exact names and attributes matter. The planning advice works whatever tool you use.

Key takeaways

  • An event is a named action, with optional properties and revenue, that tells you what a visitor did rather than which page they loaded.
  • Start with the automatic events and whatever your Tag Manager dataLayer already sends, then add a handful of custom events on top.
  • Pick one naming style, name events after completed actions, and put variable detail in properties instead of new event names.
  • A goal is an event or a page you nominate as a win, and it counts at most once per visit.
  • Check that every event fires exactly once, on the real completion, before you build a report or funnel on it.
  • Event names and properties are fields you control, so keep personal data out of them.

What is website event tracking?

An event is a named action with a time and a page attached. A visitor clicked, submitted, downloaded or paid, and your analytics wrote it down under a name like Signup, File Download or Purchase.

Most tools, FunnelSights included, treat a pageview as just another event that happens to be recorded automatically. Everything else you care about is an event too.

Events can carry two kinds of extra detail:

  • Properties: key-value pairs that describe the event, such as plan: pro or format: pdf.
  • Revenue: an amount and a currency, for the events that earn money.

Back to our SaaS team. A Signup event carrying a plan property tells them how many trials started, and on which plan. A Purchase event with revenue tells them which channel brought the money. Two events answer both of the founder’s questions.

Which events are tracked automatically?

Events come from two places. Automatic events are recorded the moment the tracker is installed. Custom events are the ones you send yourself, because only your site knows the action happened.

Here’s what FunnelSights records with no setup at all:

What the tracker records on its own
What happensRecorded asSwitched off with
A page loads, or a single-page app changes routepageviewdata-manual (then send your own)
The visitor scrolls and readsengagement: scroll depth and engaged timedata-engagement="false"
A click on a link to another hostOutbound Link: Click, with the URLdata-outbound-links="false"
A click on a PDF, ZIP, DOCX and the likeFile Download, with the URLdata-file-downloads="false"
A form is submittedForm: Submissiondata-form-submissions="false"
A click on any link or buttonClick, with the element’s labeldata-autocapture="false"
A page loads with a search term in the URLSite Search, with the termdata-search-params="false"
Your Tag Manager or gtag pushes an eventThe name you pusheddata-datalayer="false"

Every automatic event is on by default. You switch one off with an attribute on the script tag, so there’s no settings screen to hunt through. The getting-started guide covers the install itself.

Scroll depth and engaged time arrive as a background event called engagement. It feeds your page metrics rather than the event list, and neither it nor pageview can be made a goal. (To count visits to a page as conversions, you use a page goal, covered below.)

For the details of each automatic event, read how to track clicks, downloads and forms without code. One surprise worth knowing now: a PDF hosted on another domain is recorded as an outbound click, not a download.

When you need a custom event

The tracker can see a form being submitted. It can’t see whether your server accepted it, which plan the person picked, or that the page they landed on was a 404.

Those need custom events. A 404 is a good example. Nothing in the browser can tell a 404 page from any other page, so your 404 template reports itself with funnelsights('404'), and the dead end shows up with the page the visitor came from.

How to plan a small set of events

The most common mistake in website event tracking is tracking too much. Every event is a row someone has to read and a name someone has to keep consistent. On most pricing plans, it’s also volume someone pays for.

So start from questions. As the guide to deciding what to measure puts it, add an event because it answers something you’d otherwise guess at. Here’s how our SaaS team’s questions turn into events:

  • “How many people finish sign-up?” needs one event, Signup, fired when the account is actually created.
  • “Which plan do they choose?” needs no new event. A plan property on Signup answers it.
  • “Do people who read the docs convert?” needs no event at all. Pageviews and a funnel answer it.
  • “Which sources bring revenue, not just visits?” needs a Purchase event carrying revenue.
  • “Is anybody using the comparison table?” is curiosity. Leave it until it becomes a decision.

Most sites end up with a handful of custom events, often fewer than ten. If your list is longer, look for entries that are the same action in different varieties. Those are one event with a property.

Check what already arrives

Before you write any code, install the tag and wait a day. Then open Goals & Events and see what’s there.

Outbound clicks, downloads and form submissions will already be listed. If your site runs Google Tag Manager or gtag, so will every event your existing tags push (sign_up, generate_lead, purchase), under the names you already use. Plenty of teams find their event plan is half done before they start.

A starting set for your type of site

  • SaaS: Signup with the plan as a property, Demo Requested, and the upgrade to paid if it happens on the website. Clicks through to your app on another subdomain arrive as outbound clicks on their own.
  • Online shop: Add to Cart, Checkout Started and Purchase with revenue. On Shopify, the custom pixel sends exactly those three.
  • Lead generation: one event per form that matters, such as Quote Requested or Callback Requested. The generic form event doesn’t say which form it was.
  • Content and media: Newsletter Signup, plus downloads of anything you gate. Scroll depth and engaged time come with the install.

How to name events so reports stay readable

Event names are stored exactly as sent. Nothing lower-cases or tidies them.

So Signup, signup and Sign Up become three separate rows in your report, three entries in the goal picker and three things a funnel could point at. Imagine adding those up every Monday.

Names are also hard to change later. A goal’s rule can’t be edited once it exists, so renaming an event means building a new goal on the new name. A few rules keep you out of trouble:

  • Choose one style and write it down: Title Case object-action (Trial Started) or GA4-style snake_case (trial_started). Either works, as long as everyone uses the same one.
  • Name the completed action. Demo Requested fires when the request succeeds. Demo Button Clicked records something weaker.
  • Keep variable detail out of the name. One Signup event with a plan property beats Signup Pro, Signup Team and Signup Free.
  • Keep names short. Ingest rejects anything over 120 characters, and the report prints the whole string.
  • Never put personal data in a name: no email addresses, no customer names, no IDs.

The automatic events have fixed names (pageview, Outbound Link: Click, File Download, Form: Submission, Click and Site Search), and events from your dataLayer keep whatever name you pushed. Our guide to event naming conventions shows how to pick a style that sits comfortably beside them.

Three ways to send a custom event

Once you know which events you need, you have three ways to send them. All three record the same thing, so pick the one that suits whoever maintains the site.

1. Call it from JavaScript

The tag defines a global function called funnelsights, with fs as a short alias unless your page already uses that name. Call it with the event name and, if you like, properties and revenue:

funnelsights('Signup', { props: { plan: 'pro' } })
funnelsights('Purchase', { revenue: { amount: 49.0, currency: 'USD' } })

Call it when the action is complete. For our SaaS team, that means the success handler of the sign-up request, not the button that starts it.

The tag loads with defer, so a call made while the page is still loading can arrive before funnelsights exists. Put this small stub above the tag, and the script replays any queued calls once it loads:

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

2. Tag the markup

Maybe nobody on the team wants to touch JavaScript, or the site lives in a no-code builder. In that case, put the event in an element’s class list.

The tracker listens for clicks and form submits and reads classes shaped like fs-event-name=…. Any other fs-event-<key>=… class becomes a property:

<a class="fs-event-name=Download fs-event-format=pdf" href="/guide.pdf">Guide</a>
<form class="fs-event-name=Quote+Requested" action="/quote" method="post">…</form>

A plus sign in a value becomes a space, so Quote+Requested is recorded as Quote Requested. If your builder won’t accept an equals sign in a class name, use two hyphens in its place.

Put form tags on the form element itself. The tracker reports forms when they’re submitted, not when a button inside them is clicked.

3. Use the dataLayer you already have

If your site runs Google Tag Manager or gtag, you may not need either of the above. The tracker reads window.dataLayer, so every push that names an event is recorded under that name:

dataLayer.push({ event: 'sign_up', method: 'google' })
gtag('event', 'generate_lead', { form_id: 'contact' })

Pushes made before the script loaded are replayed, so a purchase written into a thank-you page isn’t missed. GTM’s own gtm.* messages and page_view are skipped. Simple parameters become properties, and value with currency becomes revenue.

For the exact rules, see how to track GTM dataLayer events without re-tagging.

One warning: use one route per action. If a sign-up is already pushed to the dataLayer as sign_up, adding funnelsights('Signup') as well gives you two events, under two names, for every sign-up.

How a custom event reaches a report
  1. ActionA visitor finishes something: a sign-up succeeds, or an order completes.
  2. SendA funnelsights() call, a tagged element or a dataLayer push sends one request to the ingest endpoint.
  3. CheckIngest keeps bots and referrer spam out, validates the name, properties and revenue, and drops a repeated purchase with the same transaction ID.
  4. Roll upEvery 15 minutes, the day’s events are rolled up into daily aggregates.
  5. ReportThe event appears in Goals & Events, ready to become a goal or a funnel step.

The request goes to the ingest endpoint and nowhere else. The tracked page makes no third-party request.

How to add detail with event properties

Properties turn one event into a breakdown. Send Signup with a plan property, and the report splits sign-ups by plan without a second event.

Each property key becomes a dimension you can filter and segment by, next to page, source, device and country. If the same events carry revenue, the breakdown shows revenue too, so you can read revenue by plan.

A few limits shape what makes a good property:

  • Up to 30 properties per event. Any beyond that are dropped.
  • Flat values only. Strings, numbers and booleans are kept, nested objects and arrays are dropped, and everything is stored as text.
  • Short values. A key over 300 bytes or a value over 2,000 bytes gets the whole event rejected, so never pass a blob of JSON or a paragraph of text.
  • Few distinct values. Breakdowns keep the 100 most common values of each property per day, so a property with a new value on every event (a user ID, say) fills those rows with ones and tells you nothing.

You can also set properties once for a whole page. Any event-<key>="value" attribute on the script tag is attached to every event that tag sends. Put event-section="docs" on your documentation template, and every report can be split by site section.

How to track revenue on events

Revenue is an amount and a currency attached to an event. It lets a traffic report answer “which sources make money?” instead of “which sources send visits?”

funnelsights('Purchase', {
  revenue: { amount: 49.0, currency: 'USD' },
  props: { transaction_id: 'T-1042' }
})

The currency is a three-letter code like USD or EUR. Each site reports revenue in one currency: the one its first revenue event carried.

Events in other currencies are left out of the total and counted separately, so the dashboard can tell you how many it excluded. Nothing is converted.

Revenue attaches to the visit, so it shows against the source, campaign, page and country that visit involved. That’s how our SaaS team finally sees which channel sent the paying customers.

You might notice the transaction_id property, after all that advice against IDs. It’s the one worth sending: ingest uses it to drop the second purchase when someone reloads a thank-you page.

Revenue can also arrive without code. Value and currency on a dataLayer event (top-level or in a GA4 ecommerce object) become revenue, and on Shopify the custom pixel records each Purchase with the order total. Our guide to revenue tracking for websites covers currencies, duplicates and why analytics revenue never quite matches your accounts.

How events become conversion goals

An event records that something happened. A goal says it matters. It’s a rule that says “this event, or reaching this page, counts as a conversion.”

The tracker can’t guess your goals. It knows someone loaded /thank-you, but only you know that means a sale. So a site shows no conversion reporting until you define a goal, which beats a guessed goal showing a believable wrong number.

Goals come in two kinds:

  • Event goals name an event, picked from the ones your site has actually sent in the last 90 days. That way, a typo can’t create a goal that quietly scores zero.
  • Page goals name a path, using * for one path segment and ** for the rest of the path. For example: /thank-you, /order/*/complete or /demo/**.

Goals count once per visit. If Signup fires three times in one visit, that’s one conversion. The conversion rate is the share of visits that converted, and the dashboard only shows it once enough visits stand behind it.

You can mark one goal as primary, which makes it the default in reports that show a single goal. A B2B site can also nominate one goal as its signup stage and another as its purchase stage, so both appear side by side.

Events and goals, side by side
EventGoal
What it isA recorded action with a nameA rule naming the event or page that counts as a win
Where it comes fromThe tracker, your code or your dataLayerYou define it in the dashboard
How it’s countedEvery time it happensAt most once per visit
RateNone: it’s a countConversion rate, as a share of visits
Changing it laterSend a different name from now onRename freely; to change the rule, delete and recreate

Choose goals with care, because a goal’s rule can’t be edited once it’s created. The stored conversion counts were computed under that rule. Our guide on how to choose conversion goals walks through picking a few that matter, macro versus micro conversions, and page versus event goals.

Goals are also the building blocks of funnels. Once you have two or three, conversion funnel analysis is the natural next step.

How to check that every event fires once

An event that fires twice per action, or on the click instead of the completion, gives you a report that looks fine and is wrong. Check each new event before you build a goal, a funnel or a decision on it.

Step 1: Use an ordinary browser on the live site

The tracker ignores localhost unless the tag carries data-local. It also ignores automated browsers (Cypress, or anything that sets navigator.webdriver), so your test suite won’t show your events.

Step 2: Watch the Network tab

Open your browser’s developer tools, go to the Network tab and filter for api/event (or your own path, if you proxy ingest). Each event is one POST request, with the name in n, properties in p and revenue in $.

Step 3: Complete the action once, then try to break it

Complete the action once and count the requests carrying your event name. One is right. Two usually means the action is sent two ways, or the tag is on the page twice.

Then make it fail. Submit the form with an error, or abandon the payment. A completion event shouldn’t fire.

Step 4: Reload the confirmation page

A purchase carrying a transaction ID is dropped the second time. Any other event counts again, unless your page guards against it.

Step 5: Find the name in the goal picker

The goal picker reads incoming events directly. A new name appears there as soon as it arrives, before the reports roll up.

Step 6: Compare with a source of truth

After a few days, compare the count with your sign-up table or order system. They won’t match exactly, but they should be close and move together.

Common causes of double counting

  • The same action sent two ways, such as a dataLayer push and a funnelsights() call.
  • The script tag rendered twice, by a layout component that mounts more than once.
  • A funnelsights() call inside a component that re-renders, instead of in the success handler.
  • A thank-you page that can be reloaded or bookmarked, with no transaction ID on the purchase.

One overlap is deliberate. The Click stream records every click on a link or button, so a tagged sign-up button produces both a Signup and a Click. They’re different events, read in different reports, so nothing is counted twice.

How to keep personal data out of events

By default, FunnelSights stores no device identifiers, IP addresses or user agents. Nothing is written to the visitor’s device, and the IP and user agent are used to compute a daily-rotating visitor hash, then discarded.

Event names and properties work differently. They’re fields you control, so whatever you put in them is stored like any other value, and the privacy properties of the defaults don’t extend to them.

  • Never send an email address, a name, a phone number, an account ID or text a visitor typed as a property.
  • Send categories, such as plan: pro. Leave out anything that identifies the person.
  • Watch what you push to the dataLayer. Every simple parameter on a captured event becomes a property, so a push carrying a user_email parameter would be stored.
  • Site-search terms are scrubbed at ingest (lower-cased, with email addresses and runs of seven or more digits removed), but a phone number typed with spaces survives. Treat the scrub as a backstop.
  • The Click stream records each element’s label, preferring its aria-label. If a button shows a signed-in person’s name, give it a neutral aria-label or switch the stream off with data-autocapture="false".

This matters beyond tidiness. Whether your analytics needs consent depends on your jurisdictions and on what you collect on top of the defaults. A property holding personal data changes that answer.

FunnelSights makes no claim that using it removes a consent requirement. Analytics and consent explains what the design settles and what it leaves to you, and is analytics data personal data? covers the legal question in more depth.

Your event tracking plan, in order

Here’s the order our SaaS team would work in, and the one we’d suggest for any site:

  • Install the tag in the shared layout and confirm a pageview arrives.
  • Wait a day, then read Goals & Events to see what already arrives: the automatic events and anything from your dataLayer.
  • Write down the questions you want answered, and the events and properties that answer them.
  • Agree a naming style, then add the missing events with whichever of the three methods suits you.
  • Check each one fires once, on the real completion.
  • Nominate a few as goals, mark one primary, and build your first funnel from them.

Want to see the reports before installing anything? The sample dashboard shows events, goals and a funnel filled with demo data.

Frequently asked questions

What is event tracking on a website?

It is recording the actions visitors take, such as sign-ups, downloads, form submissions and purchases, as named events with optional properties and revenue. Pageviews tell you where people went; events tell you what they did there. Most analytics tools record some events automatically and let you send the rest yourself.

What is the difference between an event and a goal?

An event is a recorded action and is counted every time it happens. A goal is a rule you define that nominates one event, or reaching one page, as a conversion. In FunnelSights a goal is counted at most once per visit, and its conversion rate is the share of visits that converted.

How many events should a website track?

As few as answer your questions. Most sites need the automatic events plus a handful of custom ones, often fewer than ten. If two events differ only in a detail such as plan or file type, make them one event with a property.

Can I track events without a developer?

Yes, for most things. Outbound clicks, downloads, form submissions and button clicks are recorded automatically, and you can name your own events by adding classes such as fs-event-name=Signup to an element in your site builder. A developer helps when the event should fire on a completion only your code can see.

Do my Google Tag Manager events still work?

Yes. The tracker reads the dataLayer, so events pushed by GTM tags or gtag calls arrive under the names you already use, including pushes made before the script loaded. GTM’s internal gtm.* messages and page_view are skipped.

Should event names use snake_case or Title Case?

Either works, as long as you don’t mix them. Names are stored exactly as sent, so Signup and sign_up become two separate events. If most of your events already arrive from GTM in GA4’s snake_case, match that; if you are starting fresh, Title Case reads naturally beside the automatic event names.

Why is my event counted twice?

Usually because the same action is sent two ways, such as a dataLayer push and a funnelsights call, or because the script tag is on the page twice. Reloaded thank-you pages are another cause: a purchase with a transaction ID is deduplicated, but other events are not. Watch the browser’s Network tab while completing the action once.

Can I send user IDs or email addresses as event properties?

You can, technically, but you should not. Properties are fields you control and are stored like any other value, so personal data placed there is held in your analytics. Use categories such as plan or source instead, and check what your dataLayer pushes, since its parameters become properties too.

In this series