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

Purchases: Add analytics for sections in /purchases #475

Merged
merged 1 commit into from
Nov 25, 2015

Conversation

scruffian
Copy link
Member

Fixes #271 (well part of it)

This adds analytics calls to the single-purchase pages in /purchases.

Testing

  1. git checkout fix/12207-analytics
  2. Open http://calypso.dev:3000/purchases
  3. Add calypso:analytics to the debugger so you see analytics calls in your console
  4. Assert that you see these events:
  • calypso_cancel_private_registration_purchase_view
  • calypso_confirm_cancel_purchase_view
  • calypso_cancel_purchase_view
  • edit_card_details_purchase_view
  • calypso_manage_purchase_view

calypso_edit_payment_method_purchase_view is also included in EditPaymentMethod in this PR, but that component doesn't appear to be linked from anywhere right now.

The events should have a product_slug property.

  • Code review
  • QA review

@scruffian scruffian added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc. labels Nov 23, 2015
@scruffian scruffian self-assigned this Nov 23, 2015
@scruffian scruffian added this to the Purchases: v1 milestone Nov 23, 2015
@scruffian scruffian mentioned this pull request Nov 23, 2015
13 tasks
@fabianapsimoes
Copy link
Contributor

I'm having issues loading /purchases in this branch:

Error: Invariant Violation: ReactClassInterface: You are attempting to define goToManagePurchase on your component more than once. This conflict may be due to a mixin.

@fabianapsimoes fabianapsimoes added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Nov 23, 2015
@scruffian scruffian force-pushed the add/271-purchases-analytics branch 2 times, most recently from b4e93a4 to 8dc44ab Compare November 23, 2015 16:46
@scruffian scruffian added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. and removed [Status] Needs Author Reply labels Nov 23, 2015
@scruffian
Copy link
Member Author

I'm having issues loading /purchases in this branch:

Sorry, my mistake. It should be working now.

@@ -35,6 +35,12 @@ const EditCardDetailsData = React.createClass( {
sites: React.PropTypes.object.isRequired
},

getDefaultProps() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we ever going to override the default trackingSlug by using the prop? If not, we should probably just store it as a property of the class and access it with this.trackingSlug in purchasesMixin.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea

@gziolo
Copy link
Member

gziolo commented Nov 24, 2015

Once we have #586 it needs to be rebases. Maybe we should also create utility method for analytics?

@gziolo gziolo added [Status] Awaiting Fixes and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Nov 24, 2015
@drewblaisdell drewblaisdell force-pushed the add/271-purchases-analytics branch 2 times, most recently from ecef7a4 to 0fd5c71 Compare November 24, 2015 19:13
@drewblaisdell drewblaisdell 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. [Type] Task and removed [Status] Needs Author Reply labels Nov 24, 2015
@drewblaisdell
Copy link
Contributor

I rebased, moved the recordPageView function to utils, and added it to each of the sections.

@scruffian
Copy link
Member Author

LGTM 👍

(Feels weird doing that on my own PR, but none of the commits are mine)

@scruffian scruffian 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 Nov 25, 2015
scruffian added a commit that referenced this pull request Nov 25, 2015
Purchases: Add analytics for sections in /purchases
@scruffian scruffian merged commit ed538b6 into master Nov 25, 2015
@scruffian scruffian deleted the add/271-purchases-analytics branch November 25, 2015 13:08
@scruffian scruffian removed their assignment Jan 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Purchase Management Related to managing purchases such as subscriptions, plans, history, auto-renew, cancellation, etc. [Feature] Tracks Metrics & Monitoring Capturing analytics about user behavior on WordPress.com. [Type] Task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Purchases: Analytics
4 participants