Quickstart
Access
Decode GA4 is distributed via BigQuery Analytics Hub, available in all regions and multi-regions. Currently access is only on a private-offer basis, with billing via your existing linked billing account on a flat rate per TiB processed basis. Contact ga4@decodedata.io
to request private offer terms.
Pre-requisites
In order to deploy Decode GA4, you first need to create a Google Cloud Storage (GCS) bucket. This will be the storage location for compressed, transformed events data. Creating a new bucket can be achieved through the Google Cloud user interface, command line or client libraries, and the executing user or service account must have storage.objects.create
permissions on the bucket.
Note that GCS bucket names need to be globally unique, so it makes sense to use a common, company-specific prefix (e.g. company-name-project-name
) and then e.g. decode-ga4
as a suffix.
Installation
Setting the configuration options and executing the script will install decode-ga4
onto your GA4 property.
Configuration
The following options are required:
NAME | VALUE | Details |
---|---|---|
ga4_dataset_id | STRING | The ID of the dataset containing your BigQuery export, in the format project_id.analytics_XXXXXXX . |
gcs_bucket_name | STRING | The name of the Google Cloud Storage bucket in which to store compressed, transformed data. |
Deployment
Decode GA4 is installed by copying the following script to your BigQuery console, updating the configuration options and running the updated script.
Note that all configuration options
are set using the options
JSON variable.
DECLARE options JSON;
SET options = JSON """
{
"ga4_dataset_id": "project_id.ga4_dataset_id",
"gcs_bucket_name": "bucketname"
}
""";
EXECUTE IMMEDIATE (
SELECT `decode-ga4.eu.deploy_installer`(options)
);
Executing this script will create the BigQuery dataset decode_analytics_XXXXXXX
and then profile your historic data in GA4.
It will then build and deploy a set of custom functions - derived from the historic profile - into the dataset, including the stored procedure RUN()
. This is the only function you should ever need to call, as it will both execute the initial data export and subsequent incremental runs.
It can also to be used to trigger a full data refresh or specific date range data refresh. Run the function using the following syntax:
CALL `project_id.decode_analytics_XXXXXXX.RUN()`
This can be invoked manually, on a schedule or on an event-driven basis. Note that if this is invoked and there is no new data detected, only negligible metadata query costs are incurred.