my-appengineer Courses

Events and key events: what to track and how to name it

Tracking you can trust: events, campaigns and funnelsLesson20 min7 / 22

In module 1 you listed the events in your measurement plan. Now you make them real. This lesson explains how events work in modern analytics, which standard events to use for a shop, a SaaS and a course, and how to keep names and values clean so your reports stay trustworthy for years.

How event-based analytics works

Older analytics tools counted page views and sessions. Modern tools, GA4 included, count events: each interaction is recorded with a name and optional parameters (extra details).

event: add_to_cart
parameters:
  currency: EUR
  value: 49.55
  items: [{ item_id: "BED-M-GREY", item_name: "Orthopaedic dog bed M", price: 49.55, quantity: 1 }]

Some events are collected automatically (page view, first visit, session start, and in GA4 optionally scrolls and outbound clicks through enhanced measurement). Others you must send yourself, for example add_to_cart and purchase, because only your shop knows when those happen.

A key event (GA4's name since 2024 for what used to be called a conversion) is an event you mark as important for the business. Reports then show key event counts and rates per channel, campaign and landing page. Privacy-friendly tools usually call these goals.

Tip

Mark only one to three key events. If everything is a key event, nothing is. For Paws & Co that is purchase. For Bookwise it is trial_started and subscription_started. For GreenThumb Academy it is generate_lead (guide download) and purchase.

Use the standard names where they exist

GA4 has a list of recommended events with fixed names and parameters. Using them gives you ready-made ecommerce reports, and makes your setup understandable to anyone who works on it later. Even if you use another tool, these names are a sensible convention.

The recommended events reference in Google's developer documentation for GA4
Google's reference of recommended events. Use these exact names for standard actions.

The ecommerce set, in funnel order:

EventWhenKey parameters
view_item_listA category or search results page shows productsitem_list_name, items
select_itemA product in a list is clickeditems
view_itemA product page is viewedcurrency, value, items
add_to_cartA product is added to the cartcurrency, value, items
view_cartThe cart is viewedcurrency, value, items
begin_checkoutCheckout startscurrency, value, items, coupon
add_shipping_infoShipping method chosenshipping_tier
add_payment_infoPayment method chosenpayment_type
purchaseOrder confirmedtransaction_id, currency, value, tax, shipping, items
refundOrder (partly) refundedtransaction_id, value

Other useful recommended events: sign_up, login, generate_lead, search. Check the current list and parameter names in Google's recommended events reference, because they are updated from time to time.

The purchase event: get this one perfect

Your purchase event is the most important event you send. Four rules:

  1. Unique transaction_id (your order number). The tool uses it to deduplicate: if a customer reloads the thank-you page, the order is not counted twice.
  2. Fire only after the order is confirmed, not when the "Pay" button is clicked. A failed payment is not a purchase.
  3. value excluding VAT (and decide whether shipping is in it; write it down). Send tax and shipping separately if you want them.
  4. currency always, as an ISO code (EUR, PLN, GBP). Without currency, values are ignored or misread.
Watch out

Do not send personal data in events or parameters: no names, email addresses, phone numbers or street addresses, also not "hidden" in a URL, an item name or a custom parameter. Google's terms forbid it for GA4, and under the GDPR it would be processing you have no need for. Use an order number, not the customer's email, as your ID.

How it works in your country

Analytics events often count as personal data processing once they are linked to a cookie ID, user ID or IP address. The GDPR applies across the EU, but check your own regulator's guidance on analytics and data minimisation, for example the Autoriteit Persoonsgegevens (Netherlands), UODO (Poland), the CNIL (France) or the ICO (UK, under UK GDPR).

Events for a SaaS: Bookwise

A SaaS cares about sign-ups, activation and payment more than page views. Bookwise's event list:

EventTriggerParametersKey event?
sign_upAccount createdmethod (email, google)No
trial_startedTrial beginsplanYes
first_booking_createdFirst real booking made in the appdays_since_signupNo, but it is your activation metric
invite_sentSalon invites a colleagueNo
subscription_startedFirst successful paymentplan, value, currencyYes
subscription_cancelledCancellation confirmedplan, reasonNo

The marketing site can send the first two to your analytics tool. Events that happen inside the app are often better stored in your own database as well, where you can join them to accounts and calculate activation and retention reliably. If you build Bookwise on my-app.engineer, Pulse already counts visits, sign-ups and activations per app; check in Pulse how it defines an activation for your app.

Open Pulse

Events for a course: GreenThumb Academy

EventTriggerKey event?
generate_leadFree guide form submitted (after double opt-in confirmation, if you can detect it)Yes
view_itemSales page viewedNo
begin_checkoutCheckout openedNo
purchasePayment confirmedYes

Custom events and naming rules

When no standard name fits, you create a custom event. Keep a naming convention and write it in your measurement plan:

  • snake_case, lower case, no spaces: size_guide_opened, not Size Guide Opened.
  • object_action pattern: size_guide_opened, review_tab_clicked, delivery_info_viewed.
  • Specific, not generic. click with a parameter label=size_guide is harder to report on than size_guide_opened.
  • No dynamic values in the name. Never add_to_cart_BED-M-GREY; the product goes in a parameter.
  • Stable. Renaming an event breaks your trend lines. Decide once.

GA4 limits the number of custom dimensions and the length of names and parameter values; check the current limits in Google's documentation before you plan dozens of parameters. A small shop rarely needs more than five custom events.

How events get onto your site

There are three common ways, from simple to flexible:

  1. Built-in integration. Your shop system or a plugin sends standard ecommerce events for you. Least work, least control. Check in your shop dashboard whether your shop offers this and which tools it supports; do not assume.
  2. Tag manager. Google Tag Manager (or a similar tool) loads your tags and listens for a dataLayer that your site fills with event data. Flexible, and works well with consent tools.
  3. Code. Your developer, or the builder agent for an app on my-app.engineer, adds the tracking calls directly in the code, for example on the server when an order is confirmed. Most reliable for purchases and sign-ups.

For an app on my-app.engineer you can describe the tracking you want to the builder in plain language. Be precise: event names, when they fire, which parameters, and that tags may only load after consent where your country requires it.

Ask Claude
I am adding analytics tracking to my [shop / app] built on my-app.engineer. Write a precise instruction I can give to the builder agent. Events: [list from my measurement plan with trigger and parameters]. Requirements: event names in snake_case exactly as listed; the purchase event fires only after the order is confirmed on the server, with a unique transaction_id, value excl. VAT and currency; no personal data in any event or parameter; analytics tags load only after the visitor gives consent in the cookie banner (category: analytics), unless I mark the tool as exempt. Also ask the builder to add a simple way for me to see in the browser console which events fire, for testing. Do not deploy anything without showing me the change first.

Open your apps

Test before you trust

Every new event gets a test:

  • In GA4: open DebugView (in Admin) or use Google Tag Assistant to watch events arrive in real time. In other tools: use their real-time view or the browser's Network tab.
  • Click through the funnel yourself: product, cart, checkout, test order.
  • Check the names, the parameters, the value (excl. VAT) and the currency.
  • Reload the thank-you page and check that the purchase is not counted twice.
  • Repeat after rejecting cookies to confirm consent works (see module 1).
Your task

Write your final event list with names in snake_case, triggers, parameters and which one to three are key events. Implement the purchase (or sign-up) event first and test it with the checklist above. Add the other events only after that one works.

This course is general information, not personal legal, tax or financial advice. Rules, amounts and dates change: check the official source for your country before you act.