Non-Snake Case Events in GA4: Diagnosis and Solution
The Case File
Your GA4 property is collecting events, but their names are inconsistent: addToCart, User-Login, button_click, PageView. This check identifies non-snake_case event names—events that don't follow the lowercase_with_underscores format recommended by Google Analytics 4.
Snake_case means event names use only lowercase letters, numbers, and underscores to separate words (e.g., add_to_cart, user_login, page_view). When events deviate from this convention—using camelCase, PascalCase, spaces, hyphens, or mixed capitalization—you introduce naming fragmentation that silently erodes your data quality.
This isn't a critical error that breaks tracking. GA4 will still collect these events. But inconsistent naming creates friction across your entire analytics workflow, from basic filtering to advanced BigQuery analysis.
The Root Causes (Why This Happens)
Non-snake_case events enter your GA4 property through multiple pathways. Understanding where these naming inconsistencies originate is essential for preventing them.
Developer Implementation Patterns
JavaScript conventions clash with GA4 best practices. Most JavaScript developers default to camelCase for variable and function names—it's the standard in JavaScript, React, and modern web frameworks. When developers push events to the data layer without specific GA4 guidance, they naturally write:
javascriptCopy code
dataLayer.push({
'event': 'addToCart', // Developer's natural camelCase habit
'productName': 'Blue Widget'
});
Open in CodePen
According to research from the GA4 developer community, this is the most common source of non-snake_case events. Developers unfamiliar with GA4's naming conventions simply apply their language's standard practices.
Race conditions and legacy code. Older tracking implementations may have used different conventions. If your site has accumulated tracking code over years—from multiple developers, agencies, or platforms—you likely have a mixture of naming styles coexisting in your data layer.
Third-Party Integrations and Platforms
E-commerce platforms and plugins. Shopify apps, WordPress plugins, and other third-party tools often send GA4 events with their own naming conventions. Some use camelCase, others use spaces or hyphens. Unless you modify these integrations, you inherit their naming choices.
Marketing automation and CRM systems. When external platforms send events via Measurement Protocol or server-side GTM, they may use naming conventions aligned with their own systems rather than GA4 best practices.
GA4 Platform Specifics
Case sensitivity compounds the problem. GA4 treats event names as case-sensitive. This means pageView, PageView, and page_view are three distinct events. According to Google's official event naming rules documentation, this case sensitivity can accidentally fragment what should be a single event into multiple variations.
No built-in validation or warnings. Unlike some data validation issues, GA4 provides no interface warnings when you send non-snake_case events. The platform accepts any valid event name format, making it easy for inconsistencies to accumulate unnoticed.
The "So What?" (Business Impact)
Non-snake_case events create tangible operational problems that compound over time.
Analysis Complexity and Inefficiency
Manual filtering becomes error-prone. When you need to analyze all cart-related events, you must remember to filter for addToCart, add_to_cart, AddToCart, and any other variations. Miss one, and your analysis is incomplete. This cognitive overhead slows down every analyst on your team.
Exploration reports require more effort. Building custom explorations, funnels, or segments becomes tedious when you need to account for multiple naming variations of the same conceptual event. What should be a simple filter becomes a complex regex pattern or multiple OR conditions.
BigQuery Query Complications
SQL queries become verbose and fragile. If you export GA4 data to BigQuery for advanced analysis, inconsistent event names force you to write queries like:
sqlCopy code
WHERE event_name IN ('addToCart', 'add_to_cart', 'AddToCart')
OR event_name LIKE '%add%cart%'
This approach is both inefficient and risky—you might miss variations or accidentally include unrelated events.
Case-sensitive string matching increases errors. BigQuery's case-sensitive string operations mean a simple typo in capitalization breaks your query. According to BigQuery documentation, table and column names are case-sensitive by default, making consistency critical for reliable analysis.
Team Collaboration Breakdown
Documentation becomes unreliable. When your measurement plan documents add_to_cart but developers implement addToCart, your tracking documentation loses value. New team members can't trust the documentation to understand what's actually implemented.
Cross-functional communication suffers. Developers, analysts, and marketers waste time in meetings clarifying which event name variation they're discussing. "Wait, is it formSubmit or form_submission?"
Technical Debt Accumulation
Remediation costs increase over time. The longer inconsistent naming persists, the more historical data uses the wrong format, the more dashboards and reports depend on those names, and the more complex any cleanup effort becomes.
Integration challenges. When connecting GA4 to other platforms (data warehouses, BI tools, activation platforms), inconsistent naming requires additional transformation logic and mapping tables.
Data Governance and Quality Perception
Undermines stakeholder confidence. When executives see messy, inconsistent event names in reports, it signals poor data quality control. Even if the underlying data is accurate, presentation matters for trust and adoption.
Audit and compliance complications. For organizations with data governance requirements, inconsistent naming makes it harder to document what data you're collecting and prove compliance with internal standards.
The Investigation (How to Debug)
You can identify non-snake_case events in your GA4 property through several methods, even without specialized tools.
Method 1: Events Report Audit
Navigate to Reports > Engagement > Events in your GA4 property. This report lists all events collected in the selected date range.
Scan the event names column for:
Capital letters anywhere in the name (e.g., PageView, addToCart)
Spaces between words (e.g., button click, form submit)
Hyphens as separators (e.g., user-login, page-view)
Mixed separators (e.g., add-to_cart)
This manual review works for properties with a limited number of custom events but becomes impractical at scale.
Method 2: Explorations with Regex
Create a Free Form Exploration in GA4:
Go to Explore in the left navigation
Create a new Free Form exploration
Add Event name as a dimension
Add Event count as a metric
Apply a filter using regex to identify non-snake_case patterns
While GA4's exploration regex capabilities are limited compared to BigQuery, you can create multiple filters to catch common violations:
Contains uppercase letters
Contains spaces
Contains hyphens
Method 3: BigQuery Analysis (Most Comprehensive)
If you have BigQuery export enabled, you can query for non-snake_case events systematically:
sqlCopy code
SELECT
event_name,
COUNT(*) as event_count
FROM `your_project.analytics_XXXXXXXX.events_*`
WHERE
-- Check for uppercase letters
REGEXP_CONTAINS(event_name, r'[A-Z]')
-- Check for spaces
OR REGEXP_CONTAINS(event_name, r' ')
-- Check for hyphens
OR REGEXP_CONTAINS(event_name, r'-')
-- Check for starting with uppercase
OR REGEXP_CONTAINS(event_name, r'^[A-Z]')
GROUP BY event_name
ORDER BY event_count DESC
This query identifies all events that violate snake_case conventions and shows their volume, helping you prioritize which events to fix first.
Method 4: DebugView Real-Time Monitoring
Enable DebugView in GA4 (via GTM Preview mode or the GA4 debugger Chrome extension) and navigate through your site triggering events.
In Admin > DebugView, watch events fire in real-time. Each event displays its name prominently. This method helps you catch naming issues during implementation before they reach production.
The Solution (How to Fix)
Fixing non-snake_case events requires both remediation of existing issues and prevention of future violations. Your approach depends on your implementation method and organizational constraints.
Strategy 1: Fix at the Source (Preferred)
Update data layer pushes. For events triggered via data layer in your website code, modify the event name at the source.
This is the cleanest solution because it fixes the root cause. Work with your development team to update all data layer pushes to use snake_case consistently.
Modify GTM event names. For events configured in Google Tag Manager:
Open the GA4 Event tag
Update the Event Name field to snake_case
Test in Preview mode
Verify in DebugView
Publish the container
If your event name uses a variable, you have two options:
Change the source data (data layer, DOM element) to snake_case
Create a transformation variable in GTM (see Strategy 3)
Strategy 2: Use GA4's Modify Events Feature
GA4 allows you to rename events in the interface without changing your implementation. This is useful for quick fixes or when you can't easily modify source code.
Navigate to event modification:
Go to Admin > Events (under Data display in the Property column)
Click Modify event
Click Create
Configure the modification:
Matching conditions: Set conditions to identify the old event name (e.g., event_name equals addToCart)
Parameter modifications: Leave blank (we're not changing parameters)
New event name: Enter the snake_case version (e.g., add_to_cart)
Important limitations according to Google's official documentation:
Modifications only apply to future data, not historical events
You can't modify events sent via Measurement Protocol in server-to-server setups
There's a limit of 50 event modifications per property
Modifications can take up to 24 hours to process fully
This approach works well for a small number of events but isn't scalable for comprehensive naming standardization.
Strategy 3: Establish Naming Governance
Create a documented naming convention. According to Analytics Mania's best practices guide, document your standards clearly:
Event names: snake_case (e.g., form_submission, video_start)
Event parameters: snake_case (e.g., form_id, video_title)
Custom dimensions: snake_case
Implement validation processes:
Pre-implementation review: Require naming convention approval before new events go to production
GTM workspace naming standards: Include naming convention reminders in GTM workspace descriptions
Code review checklists: Add "verify GA4 event names use snake_case" to your development team's review process
Use naming templates. Create reusable GTM variable templates or code snippets that enforce snake_case by default.
Strategy 4: Bulk Remediation for Large Properties
For properties with dozens of non-compliant events:
Phase 1: Audit and prioritize
Export all event names from BigQuery or GA4 API
Identify all non-snake_case events
Prioritize by volume (fix high-volume events first)
Map old names to new snake_case equivalents
Phase 2: Implement fixes systematically
Start with the top 10 highest-volume events
Fix at the source where possible
Use GA4 Modify Events for quick wins
Update documentation in parallel
Phase 3: Parallel tracking period
Send both old and new event names temporarily
Verify new events are collecting correctly
Update dashboards and reports to use new names
After 30-90 days, stop sending old event names
Phase 4: Historical data handling
Document the change date in your measurement plan
Create BigQuery views that normalize old and new names for historical analysis
Update Looker Studio dashboards to account for both naming patterns in historical date ranges
Strategy 5: Prevent Future Violations
Automated testing: If you have a QA environment, implement automated tests that validate event names against regex patterns before deployment.
GTM variable validation: Use GTM's built-in variable formatting options where applicable, or create lookup tables that map any input to approved snake_case event names.
Developer education: Train your development team on GA4 naming conventions. Include examples in your technical documentation and onboarding materials.
Case Closed
Finding non-snake_case events manually requires systematically reviewing event reports, creating custom explorations, or writing BigQuery queries—a time-consuming process that must be repeated regularly to catch new violations.
The Watson Analytics Detective dashboard spots this Advice-level issue instantly, alongside 60+ other data quality checks. Watson automatically scans your GA4 property for naming inconsistencies, showing you exactly which events violate snake_case conventions and how frequently they occur.
Instead of spending hours auditing event names, Watson delivers a comprehensive naming quality assessment in seconds—letting you focus on fixing issues rather than finding them.
Discover what's hiding in your data: Explore Watson Analytics Detective