Forum Discussion

rsderby68's avatar
rsderby68
Resolver I
3 years ago
Solved

How to query Google Analytics 4 data via BigQuery into Power BI? Dynamic Table name?? Help!

Hello All, 

 

I set up our GA4 account to link to BigQuery, which I would like to pull the data from into Power BI.  Google can't ever make anything easy so they are creating different tables by date names and streaming tables for the day-of; on top of that it can take them up to 72 hours to actually process before a full day table it created.  

 

Does anyone have a query that would pull all the tables and combine them (or at least combine the full-day tables, and separately combine the streaming day tables)?  I'd prefer to be working from one main past-days table in Power BI (with historical information) and one day-of table for the  latest streaming data that day. 

 

Help??  This is what I am seeing in BigQuery and Power BI, below and the info from Google.  

 

 

 

 

 

For each day, streaming export creates one new table:

  • events_intraday_YYYYMMDD: An internal staging table that includes records of session activity that took place during the day. Streaming export is a best-effort operation and may not include all data for reasons such as the processing of late events and/or failed uploads. Data is exported continuously throughout the day. This table can include records of a session when that session spans multiple export operations.This table is deleted when events_YYYYMMDD is complete.

If you select the daily option when you set up BigQuery Export, then the following table is also created each day.

  • events_YYYYMMDD: The full daily export of events.

You should query events_YYYYMMDD rather than events_intraday_YYYYMMDD so you're querying a stable dataset for the day.

Updates to the tables that are created as part of BigQuery Export are governed by the time zone of the Analytics property from which data is being exported.

Streaming-export tables (events_intraday_YYYYMMDD) are updated continuously throughout the day (e.g., from 12:00:00 am until 11:59:59 pm in the property's time zone). Once a new day starts in the property's time zone, events are written to a new intraday table.

Daily export tables (events_YYYYMMDD) are created after Analytics collects all of the events for the day. Analytics will update daily tables for up to 72 hours beyond the date of the table with events that are timestamped with the date of the table, e.g., event bundles that come in late from Measurement Protocol or the Firebase SDKs. For example, if the table date is 20220101, then Analytics will update the table through 20220104 with events that are timestamped 20220101.

On occasion, Analytics may update the daily tables anytime after the 72-hour window under circumstances that require Analytics to reprocess historical data (e.g., a bug fix that remedies a processing error).

 

  • I figured out how to do this by going to the Source step and just grabbing everything into one table.  Works great! 

5 Replies