-
Notifications
You must be signed in to change notification settings - Fork 21
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
Adjust event tracking for the creating and claim buttons of Google Ads account #2419
Adjust event tracking for the creating and claim buttons of Google Ads account #2419
Conversation
…don't have to validate global event properties.
…s across multiple layers of components via `@wordpress/hooks`.
…ding steppers for use by their subcomponents.
… in `TermsModal`.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## feature/seamlessly-conversion-tracking #2419 +/- ##
===========================================================================
- Coverage 64.0% 62.6% -1.4%
===========================================================================
Files 778 321 -457
Lines 21854 5019 -16835
Branches 1212 1216 +4
===========================================================================
- Hits 13987 3141 -10846
+ Misses 7698 1709 -5989
Partials 169 169
Flags with carried forward coverage won't be shown. Click here to find out more.
|
At step 7. on onboardign flow, I didn't get I don't get it when I click "Claim Account" button in the modal in the main flow just after creating a new account. |
…oid different hook entities affecting each other. Address: #2419 (comment)
Hi @tomalec, thanks for catching this.
Sorry, I tested each event tracking separately but missed the interaction between Could you help with a new round? |
Added JS tests for the |
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.
Tested locally and reviewed the code LGTM.
Left some non-blocking comments and questions.
} ); | ||
|
||
it( 'should record click events and be aware of extra event properties from filters', async () => { | ||
await expectEventWithPropertiesFilter( |
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.
💅
I read expectEventWithPropertiesFilter
as I'd read expect(event_with_properties_filter)
, so something that starts an expectation to which I can attach matches.
But then, in this usage, "I expect the event with properties filter to do what?"
Here, the function already applies matches and actually tests.
WDYT, of renaming the function to expect___To___()
. I hope such a notion could help me with the below.
Actually, I had a hard time understanding even after reading the source code, what entity we attach the expectation to: an event, a component, a filter.; and what is the behavior we expect: to be recorded, to be recorded with given properties, to be clicked, to be filtered?
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.
Is it that we "expect the given component, to record an event of given name, with given properties filtered by given filter, once clicked on a target"?
So something like expect( Component ).toRecordEventWithFilteredPropertiesOnceClicked(eventName, properties, filterName, clickTarget )
Or do I miss something?
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.
Is it that we "expect the given component, to record an event of given name, with given properties filtered by given filter, once clicked on a target"?
Yes.
WDYT, of renaming the function to
expect___To___()
. I hope such a notion could help me with the below.
Actually, I had a hard time understanding even after reading the source code, what entity we attach the expectation to: an event, a component, a filter.; and what is the behavior we expect: to be recorded, to be recorded with given properties, to be clicked, to be filtered?
Thanks for the suggestion! Made some changes in 8348389:
- Added JSDoc
- Changed the use of the
queryElement
callback and renamed it toperformAction
- The action of triggering an event tracking is completely moved from this function to the callers
- This should make the use of this function more flexible and the naming does not need to carry the “OnceClicked”
- Renamed
expectEventWithPropertiesFilter
toexpectComponentToRecordEventWithFilteredProperties
…st a callback argument to make its purpose clearer. Address: #2419 (comment)
fade6ca
into
feature/seamlessly-conversion-tracking
Changes proposed in this Pull Request:
PT: pcTzPl-2iK-p2
Since the
context
property of most event tracking is currently hardcoded, and there is no proper way to obtain state or data from far away components when sending event tracking, this PR tries to implement it via@wordpress/hooks
. The goal is to avoid passing event properties in a prop drilling fashion, e.g.context
andstep
at the<Stepper>
layer in this PR need to be sent together in buttons several layers away.Due to the number of files being changed, to avoid this PR getting too large, I would like to use two tracking events to show how the mechanism works, and then add the remaining event tracking in a subsequent PR.
📌 Mechanism:
useEventPropertiesFilter
to handle event properties across multiple layers of components via@wordpress/hooks
.📌 Event tracking:
context
andstep
event properties to Extension and Ads onboarding steppers for use by their subcomponents.ClaimAccountButton
.context
andstep
event properties to the click event tracking inTermsModal
.📌 Extra change:
ClaimAccountButton
to reduce the duplicate implementation.Screenshots:
📷 Event tracking when clicking on button to create Google Ads account in the Extension onboarding
📷 Event tracking when clicking on button to open the claim page of Google Ads account in the Extension onboarding
📷 Event tracking when clicking on button to create Google Ads account in the Ads onboarding
📷 Event tracking when clicking on button to open the claim page of Google Ads account in the Ads onboarding
Detailed test instructions:
localStorage.setItem( 'debug', 'wc-admin:*' )
to enable tracking debugging mode.gla_ads_account_create_button_click
event is sent withcontext
andstep
gla_ads_account_create_button_click
event is sent withcontext
andstep
.Changelog entry