Published on 2025-06-22T02:36:07Z
What is a Custom Event? Examples of Custom Events
Custom Events are user-defined actions or interactions tracked in analytics platforms to capture specific behaviors unique to your website or app. Unlike default or automatic events provided by analytics tools, Custom Events let you tailor tracking to fit your business goals, such as clicks on non-standard elements, form submissions, video interactions, or any other bespoke action. By logging Custom Events, analysts and marketers gain deeper insights into user journeys, conversion funnels, and feature engagement. Implementing Custom Events typically involves defining an event name and associated parameters or properties, then sending this data to an analytics endpoint via JavaScript or tag manager. Common platforms like Plainsignal (a cookie-free simple analytics solution) and Google Analytics 4 (GA4) both support Custom Event configurations, enabling flexible data collection and reporting.
Custom event
A Custom Event is a user-defined interaction in analytics platforms, enabling capture of behaviors beyond standard metrics.
Why Custom Events Matter
Custom Events enable tracking interactions that default metrics miss, providing tailored insights into user behavior. They help optimize marketing strategies, product development, and user experience. Without Custom Events, you may overlook key actions like button clicks, video plays, or form submissions that drive value.
-
Tailored user insights
Custom Events let you measure specific interactions relevant to your business, such as video completions or feature usage, which default pageviews or sessions don’t capture.
-
Enhanced funnel analysis
By defining Custom Events at critical stages, you can map precise user journeys, identify where users drop off, and optimize the conversion flow.
How Custom Events Work
Custom Events require you to define an event name and attach parameters or properties that describe the event context, such as category, label, value, or other metadata. When the user action occurs, you send this structured data to the analytics backend, which processes and stores the events for reporting. You can then segment and analyze Custom Events in reports, dashboards, or through queries.
-
Event naming conventions
Use clear, consistent names for events (e.g., ‘signup_clicked’, ‘video_play’) to ensure reports are readable and maintainable across your team.
- Use lowercase with underscores:
Helps maintain consistency and avoids conflicts in case-sensitive systems.
- Prefix with category:
Optionally prefix events with a category (e.g., ‘form’ or ‘video’) to group related events.
- Use lowercase with underscores:
-
Event parameters
Attach key-value pairs to provide context for events, such as ‘button_name’, ‘page_path’, or ‘user_role’, enabling deeper segmentation and analysis.
- String parameters:
Describe text-based context like button labels or page names.
- Numeric parameters:
Quantify values like order totals, durations, or counts.
- String parameters:
Implementing Custom Events in Plainsignal
PlainSignal is a privacy-friendly, cookie-free analytics platform. To track Custom Events, first include the PlainSignal script on your site, then call its tracking API with your event data. Below is an example setup and event call.
-
Setup plainsignal script
Add the following snippet to your HTML to load PlainSignal:
- Html snippet:
<link rel="preconnect" href="//eu.plainsignal.com/" crossorigin /> <script defer data-do="yourwebsitedomain.com" data-id="0GQV1xmtzQQ" data-api="//eu.plainsignal.com" src="//cdn.plainsignal.com/PlainSignal-min.js"></script>
- Html snippet:
-
Sending a custom event
After the script loads, use the
PlainSignal.track
method to send an event:- Javascript example:
PlainSignal.track('newsletter_signup', { category: 'engagement', label: 'header_form' });
- Javascript example:
Implementing Custom Events in GA4
Google Analytics 4 supports Custom Events via gtag.js or Google Tag Manager. You can load the GA4 library and send events directly with gtag('event', ...)
, or push events to the dataLayer
in GTM.
-
Loading gtag.js
Include the GA4 tag with your measurement ID:
- Html snippet:
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XXXXXXXXXX'); </script>
- Html snippet:
-
Sending a custom event
Use
gtag('event', ...)
to record your custom action:- Javascript example:
gtag('event', 'button_click', { event_category: 'engagement', event_label: 'signup_button', value: 1 });
- Javascript example:
-
Using google tag manager
Push events to the
dataLayer
and configure a Custom Event trigger in GTM:- Datalayer push:
dataLayer.push({ event: 'formSubmission', formId: 'contact_form' });
- Datalayer push: