-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Help: Update Tracks props on contact form #8396
Conversation
cc @omarjackman or @jordwest if you have a second to take a look ^ |
@@ -119,7 +119,7 @@ const HelpContact = React.createClass( { | |||
|
|||
notifications.forEach( olarkActions.sendNotificationToOperator ); | |||
|
|||
analytics.tracks.recordEvent( 'calypso_help_live_chat_begin' ); | |||
analytics.tracks.recordEvent( 'calypso_help_live_chat_begin', { site_plan: site.plan.product_id } ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is a connect
ed component, it might be nice to utilize the getSitePlan
selector and pass in product_id
as a prop
to this component
analytics.tracks.recordEvent( 'calypso_help_contact_submit', { ticket_type: 'kayako' } ); | ||
analytics.tracks.recordEvent( 'calypso_help_contact_submit', { | ||
ticket_type: 'kayako', | ||
site_plan: site.plan.product_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, could re-use the productId
prop here.
@timmyc Thanks for the review! I tried the approach using
We discussed this a it in Slack, but is there a better way to get |
Upon looking at this further it seems like you kinda had it right the first time :(. The I think to support using the state selectors in the way that @timmyc suggested you'd need to make this component not use |
The code looks pretty good to me and if @timmyc has no issue with my comment above you've got a 🚢 from me. |
@omarjackman Took a last look at this with Timmy, and it looks like there's a small snag. If a user purchases an upgrade and then is somehow removed from a site, Seems like we could either:
Thoughts? This is probably a small population of users, but I have seen it before. |
131273e
to
8bd0d03
Compare
Alright-this variation could work. I added a ternary to check if
In this context, 1 equates to a site without a plan. Four cases to consider:
The only downside is that in case #4, it's possible that the user without a site actually owns a plan on WordPress.com, but we'll record them as |
Is I suggest that for this tracks ping you assume that any user can start a chat even if they have no upgrades. That should narrow down your cases to consider to two:
If using |
ab92fb8
to
fb98d41
Compare
Thanks Omar! I think using I'm not quite sure how to grab the upgrades for a user without a site offhand either. I can look at addressing that in a separate PR, but for now, I think this gets us the data we need. |
fb98d41
to
7486840
Compare
This PR updates the props we collect when a user starts a chat or submits a ticket so we can look at demand per plan.
7486840
to
eb6295b
Compare
Every Tracks event currently has
site_plan_id
passed along as a super prop. The/help/contact
page isn't specific to a site though meaning noblog_id
is passed along and the site plan isn't registered for events on the contact form. This adds in a prop ofsite_plan
so we can track live chats and Kayako tickets created per plan.To test
localStorage.setItem('debug', 'calypso:analytics');
to turn on analytics tracking in the console.In the console, the site plan should be tracked alongside the associated actions of
calypso_help_live_chat_begin
andcalypso_help_contact_submit
.Related discussion: p1475167065000286-slack-dotcom-strategery
(I also fixed a line length warning from ESLint)
cc @kriskarkoski