Sub topic 14
Common Pitfalls and How to Avoid Them
Assume you understand JavaScript event tracking, basic SQL, and the difference between a website visitor and a business customer. This chapter focuses on mistakes caused by treating GA4 like an older, session-first analytics system.
Reading GA4 Numbers Correctly
Counting events as users
GA4 stores interactions as events. A page view, purchase, scroll, and login are all events. One person can create many events, so event_count is not a user count.
Use a user metric when you need people, and use an event metric when you need interactions. Avoid adding user counts from separate rows or reports unless you understand whether the same users appear in multiple groups.
Assuming sessions are the main data unit
Sessions are derived from events. They are not containers that hold all analytics data. An event can exist without a useful session relationship, especially in imported, offline, or server-side data.
GA4 sessions also do not always match sessions in another analytics tool. Differences can result from time zones, attribution rules, late events, consent settings, and session timeout settings.
Treating active users as all users
GA4's active user metric is based on user activity and engagement rules. It is not simply the number of distinct identifiers that appeared in the date range. Total users, active users, and new users answer different questions.
Choose the metric before interpreting a trend. A report showing fewer active users does not necessarily mean fewer distinct visitors.
Sending and Registering Data
Sending a parameter but not registering it
A custom parameter can arrive with an event and still be absent from standard reports. Register the parameter as a custom dimension or custom metric before expecting it to appear in the reporting interface. Registration does not usually backfill historical reports.
gtag('event', 'tutorial_step_completed', {
step_number: 3,
tutorial_name: 'ga4_data_model'
});For numeric values, decide whether the value describes an attribute or a quantity. Use a custom dimension for a category such as plan_type. Use a custom metric for a number such as step_number when aggregation makes sense.
Creating duplicate events
Duplicate implementation is common when the same interaction is sent by a tag manager, site code, and a server-side integration. A purchase sent twice can inflate revenue and transaction counts.
Give each integration a clear responsibility. Test one interaction in DebugView and compare the browser, network request, and destination reports. Do not “fix” duplication by filtering randomly after the fact.
> callout warning > Do not send sensitive personal information, such as email addresses or phone numbers, in event parameters, user properties, or User-ID values. Use an internal, non-personal identifier where appropriate.
Misusing Identity and Ecommerce Data
Expecting User-ID to identify everyone
User-ID works only when your application knows a stable signed-in identifier and sends it correctly. It does not identify anonymous visitors before login, and changing the identifier can fragment a person's history.
Never use an email address as a User-ID. Use a stable internal ID and follow your organization's privacy requirements.
Flattening ecommerce items
Ecommerce products belong in the items array. Putting item_id or price only at the event level loses product-level detail and makes item reports unreliable. Validate that every item has the fields required by your reporting design.
Misreading BigQuery rows
In the BigQuery export, one row generally represents one event. Parameters are stored in a repeated event_params array, and item data is stored separately. Querying COUNT(*) as a user count is therefore incorrect.
Extract parameters explicitly and build a session key from the pseudo-user identifier and ga_session_id when that parameter is present.
SELECT
event_date,
COUNT(*) AS event_count,
COUNT(DISTINCT user_pseudo_id) AS users
FROM `my-project.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX = '20240131'
GROUP BY event_date;A Practical Review
Before publishing a new event, check its name, parameters, identity behavior, duplication risk, privacy implications, and reporting registration. Then test anonymous and signed-in journeys separately.
Exercise
A custom parameter appears in DebugView but not in a standard report. What should you check first?
Show answer
Check that the parameter is registered as the appropriate custom dimension or custom metric, and remember that registration does not backfill historical reporting data.