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 cpc classification and add test #306

Merged
merged 3 commits into from
Mar 19, 2024
Merged

fix cpc classification and add test #306

merged 3 commits into from
Mar 19, 2024

Conversation

dgitis
Copy link
Collaborator

@dgitis dgitis commented Mar 12, 2024

Description & motivation

Resolves #302

Google has started sometimes setting source and medium values to google / organic when a visitor clicks an ad.

This breaks the code that we use to fix google / cpc source/medium values that are mis-attributed to google / organic in the stg_ga4__events file.

This PR fixes that issue and adds a test to detect when it might happens again.

Checklist

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

@dgitis
Copy link
Collaborator Author

dgitis commented Mar 12, 2024

@cfrye2 I've just published a branch with your fix and added a test.

Do you still have a client that's getting cpc assigned to organic?

If so, can you copy this file into your tests folder and run dbt test --select page_location_with_gclid_is_cpc?

I haven't been able to verify that this test fails when it should.

@dgitis
Copy link
Collaborator Author

dgitis commented Mar 13, 2024

I just confirmed with @cfrye2 that the test with original_page_location now fails when it is supposed to.

@adamribaudo-velir adamribaudo-velir merged commit fd6fe8b into main Mar 19, 2024
1 check passed
@adamribaudo-velir adamribaudo-velir deleted the gclid branch March 19, 2024 11:09
chienazazaz added a commit to chienazazaz/dbt-ga4 that referenced this pull request Mar 27, 2024
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.

GA4 raw data format can break google / organic gclid fix
2 participants