One of many thrilling new options launched with GA4 is the flexibility to export person occasions to BigQuery – obtainable to all GA accounts (beforehand this was restricted to solely GA360 customers). Not like the GTM strategy above, GA4 BQ may have each cellular and net occasions and requires no shopper facet modifications. To make the most of this function, Cloud Retail natively helps importing historic person occasions through GA4 BQ.
To do this function out you will have to succeed in out to your help group to allowlist your mission for it. After being allowlisted, the next steps are required:
Allow DataFlow API (that is used to remodel the information from GA4 to Cloud Retail).
Grant the next permissions to service accounts utilized by Cloud Retail:
firstname.lastname@example.org has iam.serviceAccounts.actAs permission on the Compute Engine default service account
If the BQ is in one other mission than your Retail resolution, you will have to grant each the Retail and Compute Engine service account Bigquery Admin position.
Name the Retail API import with data_schema=’ga4′, or go to the Retail console Import tab and select GA4 as your BQ person occasions schema.
GA4 BQ exports shards every day right into a separate desk, so you will have to import every day utilizing a separate import name.
Caveats: GA4 BQ has limitations on what jobs you’ll be able to carry out at no cost such because the variety of occasions that may be exported, study extra. Information Move additionally incurs prices on the top use. See Information Move pricing. This price is amortized by subsequent Retail mannequin coaching and prediction prices.
Who is that this for: Any buyer desirous to import their historic occasions.
Who is that this not for: This resolution can work for most individuals, nevertheless it solely has the flexibility to import occasions in bulk. You’ll need to make use of GTM or GA4 BQ Streaming to get real-time occasions. GA4 additionally doesn’t enable backfilling information into BQ, so so as to have historic information, you must have the BQ export arrange previous to integrating with Cloud Retail.
GA4 BQ Streaming [Availability: Public Preview]
Along with supporting a batch export to BQ, GA4 additionally helps streaming occasions into BQ in close to real-time. Not like the GTM strategy above, GA4 BQ may have each cellular and net occasions and requires no client-side modifications. To make the most of this functionality, we’ve got architected a system on high of Cloud Features and Cloud Scheduler that periodically polls information from GA4 BQ and streams them to Cloud Retail API.
The Cloud scheduler will set off a Cloud Operate to run each one minute, and pull the latest information and ship it to Cloud Retail. Detailed directions are in our buyer help Github.
By default, for house web page view occasions, the import will ingest web page views with a url that has no suffix after “/” e.g. myhomepage.com or myhomepage.com/. To ingest house web page views that don’t match in opposition to these, you will have to succeed in out to your help group.
To do this function out you’ll presently want to succeed in out to your help group to allowlist your mission for it.
Caveat: On condition that occasions would possibly arrive out of order and no timestamp exists for when the information was written, the perform would possibly pull duplicate occasions into Cloud Retail (however our fashions can deal with this). GA4 BQ streaming additionally offers no SLOs on e2e latency. That being mentioned, the latency from our personal empirical evaluation suggests latency on the order of lower than 1 minute.
Who is that this for: Clients who don’t use GTM and don’t need to do client-side modifications. That is additionally ultimate for patrons who’ve cellular apps, provided that GTM gained’t cowl these.
Who is that this not for: Clients who want SLO-backed real-time occasions and don’t need to deploy a server-side resolution – GTM is a greater possibility on this case.
Cloud Features for Firebase [Availability: Public Preview]
From a practical standpoint, there are conditions the place minimizing the time an occasion captured by GA4 happens and enriching the Retail AI fashions may be key, particularly on the buyer’s native apps stage the place, for a lot of retailers, the visitors from the purposes represents a excessive proportion of the worldwide visitors.
To assist information you thru this part, it’s useful to know how the information will move by way of the system:
The native Android or iOS app generates an analytics occasion
The Cloud Features for Firebase set off for the analytics occasion is activated.
The Cloud Operate configured to deal with the occasion begins processing, and sends information to the Cloud Retail API
Cloud Retail receives the information and processes it for consumption in fashions and serving methods.
On this part we’re going to present an implementation technique primarily based on the rules of occasion pushed structure. The important thing concept is to extract a GA4 occasion generated on the cellular app and produce a Suggestions AI occasion to inject into the Cloud Retail system in actual time. This shall be achieved by way of the next 5 steps:
Let’s have a look at the setup steps in additional element.
Configuring Firebase to ship Analytics occasions to Google Cloud
Earlier than continuing to this step, we have to log the occasion through the Google Analytics for Firebase SDK – study extra.
As soon as we’ve got instrumented Firebase to log Analytics occasions, we are able to configure Firebase to ship these occasions in real-time by going to the Firebase console and marking all related occasions as conversions, as proven within the following determine. Occasions not marked as a conversion should not despatched in actual time.