Closed FloDevelops closed 5 months ago
The stream ID is a more robust method of determining where the data came from given that 1 property can have multiple streams. Can you describe a use case where the property ID provides value above and beyond the stream ID?
The property ID simplifies analyzes by property ID and name (with a mapping seed) regardless of the number of streams for each property.
It also enables to build URLs to the GA4 UI.
@FloDevelops have you tested this on a property with intraday tables? I get the following error:
13:23:54 Completed with 1 error and 0 warnings:
13:23:54
13:23:54 Database Error in model base_ga4__events (models\staging\base\base_ga4__events.sql)
Bad int64 value: intraday_20240604237690264
compiled Code at target\run\ga4\models\staging\base\base_ga4__events.sql
@adamribaudo-velir Indeed I did not test on intraday tables. I just fixed that now.
This looks good. Just be aware that the default behavior when adding a new column to an incremental model is to ignore the change until a full refresh. Users can update their config to append the new column
Description & motivation
This PR adds a new
property_id
column to thebase_ga4__events
model which is derived from either the name of the imported dataset or theproperty_ids
dbt variable (depending on whether this is a multi-property or single-property project).Note that the default behavior of dbt is to ignore new columns during incremental runs. This behavior can be overridden with the
on_schema_change
configuration https://docs.getdbt.com/docs/build/incremental-models#what-if-the-columns-of-my-incremental-model-changeChecklist
dbt test
andpython -m pytest .
to validate existing tests