Sub topic 13
When to Replace Enhanced Measurement with Custom Events
Assume you already have a GA4 web data stream, the Google tag is installed, and you understand events and parameters. Enhanced measurement is useful for common interactions, but it is not a complete tracking plan. Replace or supplement it when its event definition, timing, or coverage does not match the question you need to answer.
Use enhanced measurement when the default meaning is enough
Enhanced measurement is a good fit when you need broad, low-maintenance signals:
- A visitor reaches 90% of a page.
- A visitor clicks a link to another domain.
- A visitor downloads a recognized file type.
- A visitor submits a standard HTML form.
- A visitor searches using a supported query parameter.
- A visitor watches an embedded YouTube video.
These events are quick to enable and use standard names such as scroll, click, file_download, and form_submit. Their consistency makes them useful for basic reporting.
The limitation is that the built-in event answers a general question. For example, click tells you that an outbound link was clicked. It does not necessarily tell you that the click was the pricing call to action, the partner referral, or the footer link you care about.
Choose a custom event for a business-specific interaction
Use a custom event when the interaction has a meaning that the built-in event does not express clearly. Give the event a specific name and send only useful parameters.
document.querySelectorAll('a[data-track="pricing-cta"]').forEach((link) => {
link.addEventListener('click', () => {
gtag('event', 'cta_click', {
link_text: link.textContent.trim(),
link_url: link.href
});
});
});This event distinguishes pricing calls to action from every other outbound click. It can answer questions such as “Which pricing link produces the most engagement?” Register link_text or another useful parameter as a custom dimension if you need to analyze it in standard reports.
Do not create a custom event merely to rename a built-in event. If scroll at 90% answers your question, keep it. Add a custom event only when you need different thresholds, conditions, or context.
Compare the built-in event with the required measurement
| Requirement | Enhanced measurement | Custom event choice |
|---|---|---|
| Any visitor reaches 90% depth | `scroll` | Keep the built-in event |
| Compare 25%, 50%, and 75% depth | Only 90% | Send a custom `scroll_depth` event |
| Any outbound link click | `click` | Keep the built-in event |
| Clicks on one important CTA | Too broad | Send a filtered `cta_click` event |
| Standard YouTube engagement | Supported with setup | Use custom tagging for other players |
| A multi-step product interaction | Not covered | Define events for each meaningful step |
Add custom events when coverage is missing
Some interactions need custom tracking because enhanced measurement does not cover them. Examples include:
- Opening a modal or accordion.
- Selecting a product option.
- Starting checkout.
- Completing an application step.
- Playing a self-hosted video.
- Using a search interface that does not update the URL.
- Reaching a business-defined engagement threshold.
A single custom event should describe one meaningful action. Use parameters for properties of that action, such as product_id, step_name, or percent_scrolled.
Prevent duplicate and competing events
Duplicates usually happen when the same interaction is tracked by enhanced measurement and by Google Tag Manager, a plugin, or application code. For example, one form submission might produce both form_submit and a custom generate_lead event. That can be correct if the events have different purposes, but sending two events with the same meaning can inflate counts.
Before adding custom code:
- Search the site and tag manager for existing tracking.
- Identify which event is the source of truth.
- Give different events different purposes and names.
- Test one interaction in DebugView.
- Document the event and its parameters.
Make the decision from the reporting need
Custom events add maintenance work. They require code, testing, naming rules, and often custom dimensions. Use them when the additional detail changes a decision, such as identifying a conversion step or comparing product actions. For simple page engagement, the built-in event is usually the better choice.
Exercise
Enhanced measurement records a 90% scroll, but the team needs to compare 25%, 50%, and 75% engagement. Should you disable enhanced measurement or add custom tracking?
Show answer
Keep enhanced measurement for the built-in 90% scroll event and add a separate custom event such as scroll_depth with a percent_scrolled parameter. Verify that the custom code fires each threshold only once.