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! Go to 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_name | revenue |
null | 371928 |
(referral) | 12127 |
name_campaign_1 | null |
name_campaign_2 | null |
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.