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

Analytics: Add utm URL params to page view event #6452

Merged
merged 1 commit into from
Jul 1, 2016

Conversation

mattm
Copy link
Contributor

@mattm mattm commented Jun 30, 2016

This PR adds utm tracking support to Calypso by adding each utm query parameter as an event property for the calypso_page_view event. This will enable us to point ads to Calypso and be able to measure their impact on user behavior broken down by source, campaign, medium, etc.

To test:

  1. Turn on debugging for the Analytics module:

localStorage.setItem('debug', 'calypso:analytics');

  1. Go to http://calypso.localhost:3000/plans. Verify there is a debug message with:

Record event "calypso_page_view" called with props {path: "/plans"}

  1. Go to http://calypso.localhost:3000/plans?utm_campaign=email. Debug message should now contain props: {path: "/plans", utm_campaign: "email"}

  2. Go to http://calypso.localhost:3000/plans?test=derek. Debug message should not include this parameter because it doesn't begin with utm_. Props should just be {path: "/plans"}.

Test live: https://calypso.live/?branch=add-utm-param-tracking

@mattm mattm added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature] Tracks Metrics & Monitoring Capturing analytics about user behavior on WordPress.com. labels Jun 30, 2016
@dbspringer
Copy link
Member

Looks good! 🚢

At some point we probably ought to es6-ize this file, but that's a separate project.

@dbspringer dbspringer added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Jun 30, 2016
@mattm mattm merged commit 6b8f603 into master Jul 1, 2016
@mattm mattm deleted the add-utm-param-tracking branch July 1, 2016 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Tracks Metrics & Monitoring Capturing analytics about user behavior on WordPress.com.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants