Velir / dbt-ga4

dbt Package for modeling raw data exported by Google Analytics 4. BigQuery support, only.
MIT License
289 stars 128 forks source link

User Export #317

Open dgitis opened 2 months ago

dgitis commented 2 months ago

Description & motivation

Work-in-progress resolving #285.

The goal of this PR is to support the pseudonymous_user_id and user_id tables.

My initial thought is that we should keep both the package's current user tables and new ones derived from the new user export options in GA4. The reason for this is to support both old and new installations.

README modifications are not done, but I expect we will want to add a new section on disabling user models that explains the differences between our various models and how to use them.

What defaults should we have for +enable on these tables?

This PR supports audiences fields from the export. While working with a test site that has implemented audiences, the data doesn't seem to be very useful unless its ID field joins with Google Ads audience exports. Despite this, I think we should leave this in because it needs to be enabled by a variable.

The user_properties fields were done without sample data. Naming and logic will likely need to be updated.

Multi-site is not currently supported.

We also might want to move the logic in base_ga4___* models to stg_ga4__* models.

I also need to review package naming conventions to ensure data, like geo data, is consistent with elsewhere in the package.

To-do:

Here are the docs for the source tables.

Checklist