How to Fix Undefined in Google Analytics
Seeing "(not set)" or "undefined" in your Google Analytics reports can feel like hitting a dead end. You're looking for clear insights into your website's performance, but instead, you get a value that tells you nothing. This article will explain exactly why this happens and provide straightforward, step-by-step instructions to diagnose and fix the most common causes of undefined data in GA4.
What Does "Undefined" or "(not set)" Mean?
In Google Analytics 4, "(not set)" is a placeholder used when GA hasn't received any information for a specific dimension you're looking at. It isn't an error in the sense that your analytics is broken, rather, it’s a symptom of missing data for that particular piece of your report. Think of it like a form field that was left blank - GA has a spot for the data, but nothing was sent to fill it in.
You’ll commonly see this value pop up in several reports, including:
- Page title & Page path: When a hit is recorded without an associated page title or URL.
- Landing page: When a session begins without a
page_viewevent. - Traffic source/medium: The classic case of missing or broken UTM parameters.
- Custom dimensions: Data you're trying to send to GA that isn't configured correctly.
Each of these has its own specific cause and a distinct solution. The key is to first identify where the undefined data is appearing and then trace it back to the source.
Common Causes of "Undefined" Data (And How to Fix It)
Let’s walk through the most frequent scenarios where you'll encounter "(not set)" and detail how to resolve them.
1. "Undefined" or "(not set)" Page Titles
If you have a significant amount of traffic showing a page title of "(not set)" in your Pages and Screens report, it typically means a page_view event was triggered before the page's title was loaded and available to be captured.
Why It Happens:
- Slow-loading titles: The page title is set by JavaScript after the initial page load, and the GA4 tag fires before the title is ready.
- Single Page Applications (SPAs): In frameworks like React or Vue.js, the user navigates between "pages" without a full page reload. If you haven't configured additional tracking, GA4 will only ever record the initial title of the first page that loaded.
- Tag placement: The GA4 tracking tag might be placed high up in the document, firing before the
<title>tag in the HTML has been processed.
How to Fix It:
- Check Your Tracking Code Placement: Ensure your Google Tag (gtag.js) or Google Tag Manager (GTM) snippet is placed correctly in your site’s
<head>section. While this is standard practice, implementation errors happen. - Modify Tag Firing for SPAs: For Single Page Applications, treat each navigation change as a virtual pageview. In GTM, use a "History Change" trigger to listen for browser history updates and fire a GA4 event with the updated
page_title. - Debug Your Implementation: Use GA4’s built-in DebugView. When browsing your site with a debug extension or in GTM’s Preview mode, observe the stream of
page_viewevents. Expand them to see parameters, especiallypage_title, to verify if it’s being captured correctly.
Example in GTM: When your SPA navigates, push an updated page title to the data layer and have your GA4 config tag re-fire on a custom event or history change to capture the new title.
2. "(not set)" in Traffic Source Reports
Seeing "(not set)" as a session source/medium is one of the most frustrating analytics issues, as it hides where your traffic is actually coming from. This all comes down to campaign tagging.
Why It Happens:
- Missing UTM Parameters: You’re running manual campaigns (e.g., emails, social media posts, or affiliate links) without adding UTM parameters (
utm_source,utm_medium,utm_campaign) to your destination URLs. - Broken or Inconsistent UTMs: UTMs might be formatted incorrectly (e.g., using a
?instead of an&after the first parameter) or inconsistent naming conventions like "facebook" vs "Facebook." - URL Redirects: Redirects (like 301s or URL shorteners) can strip UTM parameters before the user lands on your site.
- Google Ads Auto-Tagging is Off: If your Google Ads and GA accounts aren’t linked correctly, or auto-tagging is disabled, the
gclidwon’t be appended, causing paid traffic to be misclassified.
How to Fix It:
- Always Use a URL Builder: Use Google's Campaign URL Builder to generate properly formatted links.
- Create a UTM Naming Convention: Standardize how you name sources, mediums, and campaigns—use lowercase, underscores instead of spaces, and be consistent.
- Test Your Redirects: Click on campaign URLs and verify the presence of UTM parameters in the final URL after redirects.
- Enable Auto-Tagging in Google Ads: Log into Google Ads >
Admin>Account Settingsto ensure auto-tagging is enabled to appendgclid.
3. "(not set)" Landing Pages
This occurs when a session is recorded, but the initial page_view event is missing, leaving the landing page as "(not set)".
Why It Happens:
- Tag Firing Order Issues: Other events fire before the GA4 configuration tag loads, e.g., scroll tracking or custom events.
- Long Session Timeouts: User inactivity longer than default 30 minutes causes session resets, and subsequent interactions may not have a starting pageview.
- Measurement Protocol Hits: Sending server-side data without an initial pageview.
How to Fix It:
- Check Tag Firing Order in GTM: Ensure GA4 Config tags trigger on "All Pages" and before other event tags.
- Review Session Timeout Settings: Adjust session timeout duration if necessary under GA4 data stream settings.
- Audit Custom Events: Confirm that core pageview events are firing first, especially on page load, and use DebugView to verify sequence.
4. "(not set)" in Custom Dimensions
Custom dimensions track data unique to your business. When "(not set)" appears, it means an event with that custom parameter didn’t include the data or wasn’t registered correctly.
Why It Happens:
- Dimension Not Registered: You’ve not created the custom dimension corresponding to the event parameter.
- Naming Mismatch: The parameter name in your event code doesn’t match the registered dimension.
- Missing Parameter Value: The event was sent without a value for that parameter.
How to Fix It:
- Register the Dimension: In GA4, go to
Admin > Data Settings > Custom Dimensionsand create a dimension matching your parameter. - Use DebugView: Verify that the parameter is being sent correctly with events. Adjust your code or tag setup if needed.
Proactive Steps to Prevent Undefined Data
- Use Debugging: Regularly check DebugView in GA4 for incoming data issues.
- Standardize UTM Naming: Maintain consistent naming conventions.
- Use a Tag Management System: Manage tags centrally with GTM for better control.
- Thorough Testing: Preview URLs before launching campaigns to ensure tracking works.
Final Thoughts
Understanding and fixing undefined parts in your analytics isn’t just about solving today’s problems, it’s about getting a clear picture of user behavior. Make it a habit to review UTM parameters, event tracking setups, and installation updates to ensure that data doesn't go missing in the future.
By making sure everything is correctly implemented, you're not only improving the accuracy of your reports but also enhancing your ability to make data-driven decisions. Use this guide to navigate and mitigate issues in Google Analytics more effectively.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?