Quickstart

Activate

Decode GA4 needs to be activated for individual projects via Google Cloud Marketplace.

Deploy

Once activated, replacing the options values in the following script with your specific values will deploy the installer function into your GA4 dataset:

DECLARE options JSON;

SET options = JSON """
    {
        "ga4_dataset_id": "project_id.ga4_dataset_name",
        "gcs_bucket_name": "bucketname"
    }
    """;

EXECUTE IMMEDIATE (
    SELECT `decode-ga4.eu.deploy_installer`(options)
    );

This will deploy the install_decode_ga4 routine into the GA4 dataset identified by the ga4_dataset_id.

Install

Execute the installation script by running:

CALL `project_id.ga4_dataset_name.install_decode_ga4`();

This will install Decode GA4 with the standard set of default installation options. See the configuration section for details on the customization options available at installation.

Running install_decode_ga4 will then profile your existing data and build a custom set of functions into a new dataset called decode_analytics_XXXXXXX, where analytics_XXXXXXX is the name of your GA4 dataset. Alongside the functions deployed to transform the data, the RUN routine is the mechanism via which the transformations are executed.

Run

In order to run the transformation with the default options, simply call the routine:

CALL `project_id.decode_analytics_XXXXXXX.RUN`();

This will execute the transformation with the default transform configuration.

Schedule

This can be invoked manually, on a schedule or on an event-driven basis. Note that if the RUN routine is invoked and there is no new data detected, only negligible metadata query costs are incurred.