Install

Example Usage - Quick Installation (External Destination)

DECLARE options JSON;

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

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

Example Usage - Quick Installation (Partitioned Destination)

DECLARE options JSON;

SET options = JSON '''
    {
        "ga4_dataset_id": "project_id.ga4_dataset_name",
        "transform_config_template": "events_partitioned"
    }
    ''';

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

Example Usage - Installation to Custom Dataset (External Destination)

DECLARE options JSON;

SET options = JSON '''
    {
        "ga4_dataset_id": "project_id.ga4_dataset_name",
        "transform_config_template": "events_external",
        "gcs_bucket_name": "bucketname",
        "deployment_dataset_id": "project_id.custom_dataset_name"
    }
    ''';

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

Example Usage - App Stream Installation (External Destination)

DECLARE options JSON;

SET options = JSON '''
    {
        "ga4_dataset_id": "project_id.ga4_dataset_name",
        "transform_config_template": "events_external",
        "gcs_bucket_name": "bucketname",
        "stream_type": "app"
    }
    ''';

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

Argument Reference

  • ga4_dataset_id - (Required) The project_id.dataset_name of the dataset containing your GA4 BigQuery export.

  • transform_config_template - (Required) The name of the transformation configuration template to use, events_external or events_partitioned.

  • gcs_bucket_name - (Required for events_external config) The name of the Google Cloud Storage bucket in which to store compressed, transformed data.


  • deployment_dataset_id - (Optional) The project_id.dataset_name of the dataset into which Decode GA4 will be deployed. Default is project_id.decode_analytics_12345678, aligned to your ga4_dataset_id integer suffix.

  • stream_type - (Optional) The type of GA4 stream (app/web/all), which defines default values for event names and parameters. Default is web.

Event Names

  • include_observed_events - (Optional) Boolean to determine whether to include observed events in the transform. Default is true.

  • include_default_events - (Optional) Boolean to determine whether to include default events for the stream_type in the the transform. Default is true.

  • conversion_event_names - (Optional) Array of event_name values to classify as conversions. Default is ['purchase'].

  • exclude_event_names - (Optional) Array of event_name values to exclude from the transform.

  • custom_event_names - (Optional) Array of additional event_name values to be included in the transform.

Event Parameters

  • include_observed_event_params - (Optional) Boolean to determine whether to include observed event parameters in the transform. Default is true.

  • include_default_event_params - (Optional) Boolean to determine whether to include default event parameters for the stream_type in the transform. Default is true.

  • exclude_event_params - (Optional) Array of event_param names to exclude from the transform.

  • custom_event_params - (Optional) JSON array of event_param name and type (string, int, float) to be included in the transform.

User Properties

  • include_observed_user_properties - (Optional) Boolean to determine whether to include observed user properties in the transform. Default is true.

  • exclude_user_properties - (Optional) Array of user_property names to exclude from the transform.

  • custom_user_properties - (Optional) JSON array of user_property name and type (string, int, float) values to be included in the transform.

Item Parameters

  • include_observed_item_params - (Optional) Boolean to determine whether to include observed item parameters in the transform. Default is true.

  • exclude_item_params - (Optional) Array of item_param names to exclude from the transform.

  • custom_item_params - (Optional) JSON array of item_param name and type (string, int, float) values to be included in the transform.