-
Creating a data-driven dashboard with Big Query for Google Analytics in Data Studio
Right now, I’m in the process of reimagining my Google Analytics dashboard using the Big Query connector in GA4. I’m designing a custom query that plucks the exact data I need from BigQuery to display it in Data Studio. When I do a simple KPI calculation using this data, everything comes through perfectly. Trouble seems to start when I attempt to delve into custom event data. To make this data accessible, I first have to “unnest” it. Then things get tricky because the freshly unnested data needs to be grouped or the query throws its toys out of the pram. It gets more complicated because this act of grouping seems to toss my previously calculated KPIs out of whack, inflating the values. Cue head scratching. So the golden question: how do I handle this query properly? I’ve attempted pulling all raw data in and using custom fields in Data Studio to calculate the fields I need, but that was like going down a rabbit hole.
--- Here's the SQL query I've been wrestling with --- SELECT distinct event_date, event_timestamp, event_name, user_pseudo_id, device.category, ...(snip)... GROUP BY 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
As you can see, I’m feeling all tangled up in SQL, not sure how to get the results without a hiccup. If you’ve been down this road before or have some savvy insight to share, I would really appreciate it.
Log in to reply.