Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Not matching results from GA4: campaign_name and purchase_revenue in BQ

Hello there! 

So lately I've been trying to pull out the data from campaign_name and purchase_revenue_value in one table but the data displayed is wrong. Althought I get different campaign names in my columns, most of them have null values. I've tried different queries but every time I get the same error, does anyone has faced this escenario before? 

Solved Solved
0 3 2,510
1 ACCEPTED SOLUTION

 

Hello!

Thanks for taking the time to suggest different ways to solve this problem. After conducting some research and attempting several queries, I found the solution to this issue:

The problem was that when querying 'collected_traffic_source.manual_campaign_name' for example, like this

SELECT 
collected_traffic_source.manual_campaign_name AS campaign_name,
SUM(ecommerce.purchase_revenue) AS revenue
FROM 
data_set.name
GROUP BY collected_traffic_source.manual_campaign_name

The output will be something like this: 

campaign_namerevenue
null371928
(referral) 12127
name_campaign_1null
name_campaign_2null

In other words, all the campaigns within the property will have null values for revenue, except for 'referral' and 'null'. After conducting some research, I found that the correct field should have been 'traffic_source.name'. Just by making this change, I obtained the results I needed. However, I still don't know why the 'manual_campaign_name' field couldn't match the revenue per campaign as GA4 has it.

View solution in original post

3 REPLIES 3