Misattribution Fixes
There are several nuances when it comes to finding the "correct" source of an event or a session. Below is our subjective interpretation of resolving some of the misattribution issues that come with the GA4 BigQuery export.
Please contact us at support@ga4dataform.com if you know of any other misattribution issues that should be fixed!
In the table below, we show the input and output values when applying fixes for different scenarios. The input row represents the raw data (GA4 export), while the output row shows how we modify each field in the fixed_traffic_source
struct within the ga4_events
table. We then use this struct to determine the session traffic source in the ga4_sessions
table.
You can scroll the table horizontally to view all columns.
Test Case | State | source | medium | campaign | gclid/gbraid/wbraid/dclid | srsltid | page_referrer | ignore_referrer |
---|---|---|---|---|---|---|---|---|
1. Organic when GCLID is present | Input | organic | (organic) | CjwKCAjwitShBhA6E | ||||
Output | cpc | (not set) | CjwKCAjwitShBhA6E | |||||
2. Non-Google referral with GCLID | Input | pinterest.com | referral | (referral) | CjwKCAjwitShBhA6E | |||
Output | cpc | (not set) | CjwKCAjwitShBhA6E | |||||
3. UTM with GCLID (no change) | Input | google_cpc | paid_search | non_branded_search | CjwKCAjwitShBhA6E | |||
Output | google_cpc | paid_search | non_branded_search | CjwKCAjwitShBhA6E | ||||
4. SRSLTID present | Input | mail.google.com | referral | (referral) | AfmBOop4z | |||
Output | organic | Shopping Free Listings | AfmBOop4z | |||||
5. Only GCLID present | Input | CjwKCAjwitShBhA6E | ||||||
Output | cpc | (not set) | CjwKCAjwitShBhA6E | |||||
6. Google Android app referrer | Input | android-app://com.google.android.gm/ | ||||||
Output | organic | |||||||
7. Social Android app referrer | Input | android-app://com.pinterest/ | ||||||
Output | com.pinterest | social | ||||||
8. Other Android app referrer | Input | android-app://de.idealo.android/ | ||||||
Output | de.idealo.android | android-app | ||||||
9. Referrer present, ignore_referrer = FALSE | Input | domain123.com/test456 | FALSE | |||||
Output | domain123.com | referral |
Column Descriptions
Column Name | Description |
---|---|
Test Case | Name of the scenario being tested |
State | Whether the row represents input data or expected output after transformation |
source | The traffic source (e.g.: google, pinterest.com) |
medium | The marketing medium (e.g.: organic, cpc, referral) |
campaign | The marketing campaign name |
gclid/gbraid/wbraid/dclid | Google Click Identifier - used to track ad clicks |
srsltid | Google Shopping Free Listings tracking parameter |
page_referrer | The URL that referred the traffic |
ignore_referrer | Flag to indicate whether to ignore the referrer information |