-
Notifications
You must be signed in to change notification settings - Fork 799
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
Instant Search: Add TrainTracks analytics #13730
Conversation
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.
The jetpack_instant_search_traintracks_render events seem to have anon ids and the jetpack_instant_search_traintracks_interact events are picking up my wp.com id. I can't actually think of a reason why we need real ids associated with these events. I'm not even sure we need to fully persist the anon ids across page loads in a cookie but I think doing so would be good at the moment. But I don't want to do it if it means tracking folks across different sites.
I think we should remove all the parts that try to grab real user ids and entirely use anon ids since this is going to be fully on the front end of the sites. @xyu and @bperson can probably help point the way for this.
modules/search/instant-search/components/search-result-minimal.jsx
Outdated
Show resolved
Hide resolved
Considering we are analysing visitors of jetpack sites ( and not just owners of jetpack sites ), we should be extremely careful as this is new territory for Tracks in Jetpack AFAIK. Did we ever do "search sessions" analysis? By that I mean not only tweaking the search algorithms to improve the results for a specific search query, but tweaking the results so that the user gets what he searches for without having to re-tweak its search query to be more specific. If we don't think of doing analysis across different search queries, I don't think there is any value in using a persisting ID, which means we MUST NOT do it: generate a random ID, store it in a variable or a global that will get discarded if the user leaves or reloads the page. If we hope to do those analysis in a far fetch future, we should also NOT DO it and only persist those IDs once we are sure we'll actually use that data. |
modules/search/instant-search/components/search-result-minimal.jsx
Outdated
Show resolved
Hide resolved
I want to do this yes. But... a session could also be considered just all the interactions on the front end up until the page gets reloaded. So if we generate a single id each time the search app gets loaded, then that should be sufficient to at least start doing some session analysis. The only case I can think of where storing something may be good is for A/B testing and wanting to make sure we provide the end user with the same side of the A/B test after they get it once. I'm not sure that matters a lot though. So ya, let's not store anything in any cookies to start off with. |
558ca43
to
aadb531
Compare
7554497
to
a0c6a97
Compare
a0c6a97
to
4054712
Compare
I believe I've addressed all outstanding concerns, so I'll go ahead and merge this PR in an hour or so. |
* Implement minimal search results and spelling correction (#13365) * Add filtering display (#13371) * Fix search result display bugs and make improvements (#13393) * Add rudimentary support for filtering on post types (#13430) * Add support for filtering on categories and tags (#13505) * Add instant search sorting based on the URL (#13377) * Add support for filtering on dates (#13545) * Add custom taxonomy filtering (#13605) * add sort widget (#13614) * fix many theme incompatibilities (#13602) * Add infinite scrolling (#13684) * Add caching to the api requests (#13714) * Clean up some design bugs/issues (#13721) * Fix labels for post types when we have them. (#13750) * Add localization and formatting of all dates (#13748) * search from any page on the site (#13713) * Hook up default options (inc. sort) (#13742) * Add TrainTracks analytics (#13730) * Create PostTypeIcon component (#13790) * Upgrade to Preact 10 (#13794) * Add comments component (#13797) * Address review feedback
Changes proposed in this Pull Request:
This adds TrainTracks analytics calls to Instant Search results.
Is this a new feature or does it add/remove features to an existing part of Jetpack?
Yes, it adds analytics calls for rendering and interacting with Instant Search results.
Testing instructions:
define( "JETPACK_SEARCH_PROTOTYPE", true );
to your wp-config.php.Preserve Log
.stats.wp
requests in the network inspector and ensure that you see a request forstats.wp.com/w.js?60
.t.gif
requests in the network inspector and ensure that you see 10 calls fort.gif
with_en
param equalingjetpack_instant_search_traintracks_render
.t.gif
with_en
param equalingjetpack_instant_search_traintracks_interact
.Proposed changelog entry for your changes:
None.