Am currently working on a POC. We are leveraging Google analytics for our website and capturing the traffic in GA4. We setup a connection to stream the real time data from GA4 to BQ. Now we would like to stream the same data from BQ to Pub/Sub in real time.
I tried enabling the CDC events over the BQ Analytics table to publish an event to pub/sub topic and created a cloud function with event trigger on analytics table with append rows. Nothing is worked.
While BigQuery can be the target of CDC processing (changes in an up-stream database propagated to BigQuery), BigQuery is not (yet) a great streaming source of CDC records. I am not familiar with any streaming âchange detectionâ currently available in BigQuery. About the only thing I can immediately think of would be a scheduled Cloud Function that executes the BigQuery APPENDS() Table Valued Function to determine what has been appended/inserted into the table since the last invocation. The results from this can then be used to post new messages to Pub/Sub.
In your original post, you said
I tried enabling the CDC events over the BQ Analytics table to publish an event to pub/sub topic and created a cloud function with event trigger on analytics table with append rows. Nothing is worked
Can you elaborate on what you tried and where you read about it?
Iâve used the above configuration by referring to documentation to trigger my cloud function where am writing the code to fetch the newly appended rows.
Approach 2: I execute the following bash command to automatically refresh the data in materialized from my analytics table which in turn publish an event to pub/sub topic still this didnât worked as expected
Iâm working on a similar problem and havenât found a solution for it yet. Were you able to get this working?
The reason I have to use BigQuery as source is because GA4 only exports to bigquery.
I have integrated my Shopify site with GA4 and setup streaming data export from GA4 to bigquery. I wanna make use of this streaming data for a downstream application.