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

Map lowercase tagged sources to capitalized form during ingestion #4417

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

ukutaht
Copy link
Contributor

@ukutaht ukutaht commented Aug 1, 2024

Changes

This work is in preparation of a bigger project - Acquisition Channel.

This PR changes how we handle manually tagged acquisition data. When links are manually tagged, usually the utm_source parameter has a value like google or facebook. However, when we automatically detect sources based on the Referer header, we store the source field as Google or Facebook. So then we have dashboards that have both sources google and Google where the first is manually tagged traffic and the second is automatically detected.

However, both are coming from the same source so we would like to merge the lowercase and the capitalized entry in sources.

The way I've decided to tackle it here is to build a lookup table from the RefInspector library that stores all sources in a table like:

lowercase(source) -> source

We use this table to lookup google -> Google during ingestion, for example.

The logic is that if the manually passed utm_source matches the lowercase form of any known traffic source, it gets transformed and stored as the capitalized form like automatically added sources.

We have also discussed a data migration for historical data to apply the same transformation. I'll look into that next.

Tests

  • Automated tests have been added

Changelog

  • Entry has been added to changelog

Documentation

  • Docs have been updated

Dark mode

  • This PR does not change the UI

@ukutaht ukutaht requested a review from a team August 1, 2024 09:15
@macobo
Copy link
Contributor

macobo commented Aug 12, 2024

This is missing a changelog entry.

Copy link

Preview environment👷🏼‍♀️🏗️
PR-4417

@ukutaht ukutaht force-pushed the source-capitalization branch from 1a02d72 to 4145e3e Compare August 27, 2024 09:48
@ukutaht ukutaht merged commit 2e89a50 into master Aug 27, 2024
10 checks passed
@ukutaht ukutaht deleted the source-capitalization branch August 27, 2024 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants