Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix fct_ga4__pages model and add tests to catch similar issues #295

Merged
merged 2 commits into from
Jan 22, 2024

Conversation

dgitis
Copy link
Collaborator

@dgitis dgitis commented Jan 5, 2024

Description & motivation

The addition of page_engagement_key which is built from the page_referrer where page_view events are concerned was causing multiple rows with the same page_location and event_date_dt in the first CTE.

This PR adds a second aggregation in the second CTE to eliminate this redundancy and adds tests to the model to catch these issues in the future.

The fct_ga4__pages model will need a full refresh when upgrading to a version containing these changes as the new tests will trigger an error.

Resolves #274

Checklist

  • [y ] I have verified that these changes work locally
  • [y ] I have updated the README.md (if applicable)
  • [y ] I have added tests & descriptions to my models (and macros if applicable)
  • [y ] I have run dbt test and python -m pytest . to validate existing tests

@adamribaudo-velir
Copy link
Collaborator

Looks like the unique test can fail when there is a page with the same page location but different page titles (not uncommon for translated content)

@dgitis
Copy link
Collaborator Author

dgitis commented Jan 22, 2024

This latest version removes page_path and page_title from the fct_ga4__pages model which will help this model pass its uniqueness test.

Copy link
Collaborator

@adamribaudo-velir adamribaudo-velir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests passed this time!

@adamribaudo-velir adamribaudo-velir merged commit e21ceec into main Jan 22, 2024
1 check passed
@adamribaudo-velir adamribaudo-velir deleted the pages branch January 22, 2024 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

fct_ga4__pages duplicate dimension fields
2 participants