-
Notifications
You must be signed in to change notification settings - Fork 219
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
Update REACH_RESULT_END
, LOAD_MORE
, SELECT_SEARCH_RESULT
analytics events for additional search views
#3619
Comments
REACH_RESULT_END
and LOAD_MORE
analytics events for additional search views
@WordPress/openverse-frontend, what do you think is the best way of recording these events? Currently, the payload for these events is: {
/** The media type being searched */
searchType: SupportedSearchType
/** The search term */
query: string
/** The current page of results the user is on. */
resultPage: number
} For the additional search views, we need to add the I think we can update the payload to be: {
searchType: SupportedSearchType
query: string // `tag`, `source` or `source/creator` for the additional search views
strategy: "search" | "collection"
resultPage: number
} Is there anything we should add/remove? Also, @dhruvkb, do you think there are drawbacks to adding a new property to an existing event? |
REACH_RESULT_END
and LOAD_MORE
analytics events for additional search viewsREACH_RESULT_END
, LOAD_MORE
, SELECT_SEARCH_RESULT
analytics events for additional search views
I don't think there are any drawbacks. |
I've asked this before, and I can't remember what the reason for doing this approach was, but the strategy duplicates the page path, doesn't it? Search will always be Mostly asking for clarification on why the strategy property is needed separately from the page path, if it is, so that it's documented. Otherwise, I will probably end up asking the same question in a few months time 😅. Preferably a comment in the code explains this. |
Noting here that Plausible recently added the ability to filter by more than 1 custom property. I couldn't, however, find a way of filtering by the query parameters. This means that we won't be able to distinguish between the collections. If we do want to do so, we need to add a custom property for it. I think we should add the This is what I think we should send:
This way we can see how useful the users find each kind of view. If they often load more pages for one kind of "strategy", that would mean that it is a very useful feature. |
Oh! That's really exciting and great to know. That eliminates any concern I have. The expanded It's a separate code branch (sort of) from |
I'll get a PR up today, but I wanted to share my own understanding of these properties:
|
Problem
REACH_RESULT_END
andLOAD_MORE_RESULTS
events are currently sent from the additional search views with the correct values forsearchType
andresultPage
, butquery
is set to blank string""
.The
SELECT_SEARCH_RESULT
is also sent for additional search views results and has aquery
property that is currently set tosearchTerm
:openverse/frontend/src/types/analytics.ts
Lines 253 to 269 in 3e57bfa
Description
We should update the payload to add the
search view
(similar to what we have in thestrategy
in thesearch
store: 'default'/'tag'/source'/'creator', and also update the code to setquery
to thetag
for tag pages,source
forsource
pages andsource
&creator
pair for the creator pages.Alternatives
Additional context
The text was updated successfully, but these errors were encountered: