Why Is Google Analytics 4 Reporting Your Campaign Traffic as Direct? Let's Fix It!
By Zac Nash|27 Aug 2024
Ah, the eternal mystery of misattribution in Google Analytics 4 (GA4); it's like trying to figure out who ate the last slice of pizza at a party. You set up a brilliant campaign, and you're ready to bask in the glow of your marketing genius, but wait! GA4 reports it all, or some of it, as Direct traffic. How did this happen? Let's dive into why this occurs and how to fix it.
The Misattribution Menace
Misattribution happens when GA4 can't correctly identify the source of your traffic. Instead of showing the hard-earned traffic from your latest email blast or social media campaign, it dumps it into the "Direct" bucket.
This GA4 unhelpfulness not only messes with your reporting but also your understanding of what's driving your traffic.
Common Culprits for Misattribution
- Tag sequencing: Events are sent before the config command.
- Redirecting campaign landing pages: Redirects can often strip out any query string, removing all campaign information. A great example is missing the required `/` at the end of the destination URL.
- Cross-Domain measurement issues: Misconfigured cross-domain tracking.
- GA4 data modelling/attribution issue: understanding how this works and the potential time lags involved.
- User or Session ID customisation: Incorrect handling of User or Session IDs.
Quick Fire Fixes!
Before we dive into the detailed fixes for misattribution in GA4, here are some quick checks you can perform to address common issues swiftly:
- Review Property Attribution Settings
Ensure you set attribution settings to 'Data driven attribution' instead of 'Last click'. Last click can increase conversions attributed to Direct. - Enable Auto-Tagging in Google Ads
Auto-tagging imports Google Ads data into Analytics, helping you track post-click actions accurately and correct misattribution. - Use a URL Builder for UTM Tracking
Always use a URL generator for accurate and consistent UTM tracking across web and app campaigns. This helps GA4 correctly identify the source, medium, and campaign. [link to the FE one] - Mitigate (not set) Values
Review and customise your dimensions to avoid (not set) values appearing when GA4 lacks information for a dimension. - Review Channel and Campaign Mappings
Direct traffic often results from missing or ignored referral information. Review your channel group definitions and consider creating custom channel groups to better categorise your traffic. - Review the 'Unwanted Referrals' List
Contrary to common belief, the domains listed here are not excluded from your Google Analytics; instead, they have an ignore_referrer=true parameter appended, putting them straight into the Direct bucket. Use this list for payment providers like PayPal, but avoid using it too broadly.
Implement these tips and watch your GA4 reports transform into a true reflection of your marketing. If none of the steps and checks have helped you resolve your issue with Direct traffic and conversions being higher than expected, do reach out. We are always up for a challenge.
Zac Nash, Senior Data Engineer
Top 5 Fixes for Misattribution: Best Practices
1. The config tag (Google Tag) must be the first tag to fire on every page
Why It Matters
When sending an event before the config tag, it triggers a new session_start event, which won't carry the correct traffic source parameter. It subsequently sorts the following interactions into the Direct channel. This misidentification can lead to inaccurate data attribution, making it challenging to understand where your traffic is coming from.
Additionally, consent management plays a crucial role here. Depending on the integration of your Consent Management Platform (CMP) and how the Google Tag Manager (GTM) set-up reacts to changes in consent, you might end up in a situation where the config tag fires before the user consents (and is thus ignored). The subsequent event, fired after consent, might (then) miss the campaign information. This issue can create gaps in your data, resulting in a significant portion of misattribution of your traffic as Direct.
How to Implement
Ensure that your event tags are fired only after the config command. You can manage this through GTM by setting up a sequence where the config command is always triggered first, followed by other event tags.
You can check if this is an issue via GTM's preview and GA4's debug mode, which allows you to observe every hit firing as it occurs. You can also create a User Explorer report in the Explore section of GA4 to look for session sequences where a custom event was the first event to fire.
To handle consent management effectively:
- Integrate your CMP with GTM to ensure that tags fire only after obtaining user consent.
- Use GTM triggers that are conditioned on consent states to control the timing of the config command and subsequent events.
Example
- Set up your CMP to communicate with GTM.
- In GTM, use the consent mode functionality to ensure that Google tags only fire with the correct consent. Non-Google tags can be done manually using triggers or trigger exceptions that check for the correct consent before firing.
- Sequence Tags If Necessary:
- Create or Edit the Tag: Go to GTM and select the tag you want to configure. If you haven't created the tag, click "Add a new tag."
- Access Advanced Settings: In the tag configuration window, click "Advanced Settings."
- Enable Tag Sequencing: Under Advanced Settings, check the box for "Fire a tag before
<your tag>
fires." - Select the Config Tag: Click "Select Tag" and choose your GA4 config tag from the dropdown menu.
- Optional Cleanup Tag: If necessary, specify a tag to fire after the primary tag using the "Fire a tag after
<your tag>
fires" option. - Set Trigger Conditions: Ensure the main tag has the appropriate triggers to determine when it should fire.
- Test the Configuration: Use GTM's Preview mode to test the tag sequencing and confirm that tags fire in the correct order.
- GTM Configuration:
- GA4 Configuration Tag: Create a tag for the GA4 config command:
- Tag Type: GA4 Configuration
- Measurement ID: Your GA4 Measurement ID
- Trigger: CMP consent trigger
- Event Tags:
- Tag Type: GA4 Event
- Event Name: e.g., 'cta_click.'
- Trigger: cta click if consent is in place
- GA4 Configuration Tag: Create a tag for the GA4 config command:
Discuss your direct traffic challenges with one of the team
2. Redirecting Campaign Landing Pages
Why It Matters
Redirects can often strip out any query string, thereby losing all campaign information. Redirects can result in GA4 failing to track sessions and users accurately. A typical example of this issue is missing the required / at the end of the destination URL. When this happens, the redirect process removes UTM parameters, causing the traffic source information to be lost. This issue leads to GA4 categorising the traffic as Direct, which skews your data and misrepresents the success of your campaigns.
How to Implement
To prevent redirects from stripping out campaign information, ensure your URLs are properly formatted and avoid unnecessary redirects whenever possible.
Example
- Ensure Proper URL Formatting:
- Always include the trailing / in your destination URLs to prevent issues during the redirect process.
- Double-check your URLs to confirm that UTM parameters are intact after redirection.
- Minimise Redirects:
- Use direct links whenever possible.
- If redirects are necessary, configure them to retain query strings.
- Check Your Redirects:
- Test your landing page URLs to ensure UTM parameters are preserved.
- Use tools like URL builders and redirect testers to verify that campaign information is retained through redirects.
By following these steps, you can maintain the integrity of your campaign tracking and ensure that GA4 accurately attributes your traffic sources.
3. Accurate Cross-Domain Measurement Setup
Why It Matters
Cross-domain tracking ensures that user sessions are tracked seamlessly across different domains. Misconfigurations here can lead to fragmented sessions, misattributing traffic as Direct. If your business spans multiple domains (e.g., example1.com and example2.com), it's crucial that users' journeys are tracked consistently across these domains. Without proper cross-domain tracking, sessions can be split whenever users navigate from one domain to another, leading to incomplete user journeys and misattributed traffic.
How to Implement
Configure cross-domain measurement using the Analytics interface. If a custom solution is needed, use the get and set commands of the gtag.js API to maintain consistent User IDs across domains.
Example
- GA4 Interface:
- In Admin, under Data collection and modification, click Data streams.
- Click Web, then click a web data stream.
- In the web stream details, click Configure tag settings (at the bottom).
- In the Settings section, click Configure your domains.
- If you use the same Google tag across domains, they are automatically detected and show up in the Recommendations section. To accept a recommendation, click Add.
- To manually add a domain, click Add condition under Include domains that match the following conditions:
- Choose a match type.
- Under Domain, enter the identifier for the domain you want to match (e.g., example.com).
- Add each domain you want to include in cross-domain measurement.
- Conditions are evaluated using OR logic.
- Click Save.
4. GA4 data reporting/modelling/attribution issues
There are known issues with the data modelling and attribution of conversions in GA4, so the unfortunate news is that this may not be something you or your technical team/agency have done, but it could simply be down to how GA4 works.
Key events (formerly known as conversions) are modelled in GA4 when advanced consent mode is implemented, and you receive enough data to train the machine learning algorithm. This modelling of conversions requires some processing, which can take up to 12 days after the data collection date. Yes, you read correctly.. 12 days. And this number is prone to change; a week before writing this, the official documentation stated nine days. Today, it's 12 days; by the time you click the above link, it may already be more (or less)!
There is also a known issue where auto-tagged Ads traffic is reported as Google / organic in the GA4 interface. This issue is widely reported across forums and support groups, and there is no ETA for a fix, but apparently, Google is working on it. You can check if you are affected by this by creating an Explore report with the dimensions event_name (filtered for session_start), page_location and Session source/medium. If you see the GCLID parameter present in the page_location and the source/medium is google/organic, you have this problem.
5. Correct User and Session ID Customisation
Why It Matters
User ID and Session ID are typically handled automatically, except for a few advanced custom configurations. Customising User or Session IDs incorrectly can lead to fragmented data and misattribution. User IDs are unique identifiers assigned to each user, and Session IDs help group user interactions within specific time frames. If these IDs are mishandled, the same user can be counted multiple times as different users, or their sessions split incorrectly. This fragmentation results in a distorted view of user behaviour and traffic sources.
How to Implement
- User ID: Use the User_ID feature to link behaviour across sessions and devices.
- Session ID: Join user_id with session_id for unique session identification
Bonus Tip
BigQuery SQL:
CONCAT(( SELECT value.int_value FROM UNNEST(event_params) WHERE key = "ga_session_id"),"-", user_pseudo_id) AS session_id
Joining session IDs and user IDs is easy in BigQuery. Use this technique to get genuinely unique identifiers for sessions!
Get our FREE resource: How to conduct a GA4 health check
Download your FREE template, then use our step-by-step guide and use it in tandem to complete the health check.
Conclusion
Misattribution in GA4 is frustrating, but with the correct setup and best practices, you can ensure accurate reporting for your campaign traffic. Following these steps will give you cleaner data and a clearer picture of your marketing efforts' effectiveness. Accurate data leads to better decision-making and, ultimately, more successful campaigns.
Do you need help with the data or help building reports? Contact us and let us know how you think we can help.