Closed dgitis closed 8 months ago
@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.
I just confirmed with @cfrye2 that the test with original_page_location
now fails when it is supposed to.
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
dbt test
andpython -m pytest .
to validate existing tests