Velir / dbt-ga4

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

Fix test on user_id_or_client_key in fct_ga4__user_ids model #195

Closed adamribaudo-velir closed 1 year ago

adamribaudo-velir commented 1 year ago

Description & motivation

Closes #191

@TannerHopkins noticed that the uniqueness test for fct_ga4__user_ids can fail when joining together multiple data streams as it checks only the user_id_or_client_key. The client_key value already takes the stream_id values into account, but user_id does not. This means that sharing a user_id across streams would invalidate the test (despite being a valid outcome).

The test has been updated to incorporate stream_id in the uniqueness check.

Checklist

adamribaudo-velir commented 1 year ago

@TannerHopkins this should be all set if you want to retest