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

Strip google analytics URL params #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vbanos
Copy link

@vbanos vbanos commented Sep 10, 2021

Also add some unit tests

Also add some unit tests
Comment on lines +55 to +62
re.compile(b"^(.*)(?:utm_source=[0-9a-zA-Z\.]+)(?:&(.*))?$", re.I),
re.compile(b"^(.*)(?:utm_campaign=[0-9a-zA-Z\.]+)(?:&(.*))?$", re.I),
re.compile(b"^(.*)(?:utm_term=[0-9a-zA-Z\.]+)(?:&(.*))?$", re.I),
re.compile(b"^(.*)(?:utm_content=[0-9a-zA-Z\.]+)(?:&(.*))?$", re.I),
re.compile(b"^(.*)(?:utm_medium=[0-9a-zA-Z\.]+)(?:&(.*))?$", re.I),
re.compile(b"^(.*)(?:utm_social=[0-9a-zA-Z\.]+)(?:&(.*))?$", re.I),
re.compile(b"^(.*)(?:utm_social-type=[0-9a-zA-Z\.]+)(?:&(.*))?$", re.I),
re.compile(b"^(.*)(?:utm_brand=[0-9a-zA-Z\.]+)(?:&(.*))?$", re.I),
Copy link
Member

Choose a reason for hiding this comment

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

Below are a few non-critical comments:

  • These can be combined in a single RegEx
  • [0-9a-zA-Z] can be replaced with \w (thought it will include underscore as well)
  • The variable name _RES_QUERY_SESSIONID should be changed to something more generic now
  • We should also remove fbclid query parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants