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
Log click events on search homepage and repogroup page #12405
Conversation
…ked on repogroup page
web/src/repogroups/RepogroupPage.tsx
Outdated
@@ -182,11 +182,13 @@ export const RepogroupPage: React.FunctionComponent<RepogroupPageProps> = (props | |||
) | |||
} | |||
|
|||
const RepoLinkClicked = (): void => eventLogger.log('RepogroupPageRepoLinkClicked') |
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 wonder if we want to pass in any data with the event? Such as repo name in this case? I'm not sure if we are able to do that but it seems that slicing these events based on associated data can be useful
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.
If we can pass along data about the specific click that'd be ideal!
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.
@ebrodymoore pass through the actual language/example that was clicked?
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.
Yeah exactly
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.
+1, would be great if we could pass through the link clicked on:
RepogroupPageRepoLinkClicked -> Repo name or search url
ExampleSearchClicked -> search url
ExampleLanguageSearchClicked -> Language or search url
@attfarhan the naming convention is good! |
Codecov Report
@@ Coverage Diff @@
## master #12405 +/- ##
==========================================
- Coverage 50.62% 50.55% -0.07%
==========================================
Files 1415 1414 -1
Lines 79235 79133 -102
Branches 6539 6539
==========================================
- Hits 40111 40004 -107
- Misses 35666 35674 +8
+ Partials 3458 3455 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@@ -61,8 +61,9 @@ interface Props | |||
showCampaigns: boolean | |||
} | |||
|
|||
const SearchExampleClicked = (): void => eventLogger.log('ExampleSearchClicked') | |||
const LanguageExampleClicked = (): void => eventLogger.log('ExampleLanguageSearchClicked') | |||
const SearchExampleClicked = (url: string) => (): void => eventLogger.log('ExampleSearchClicked', { url }) |
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.
It seems the the url itself might not as human readable and stable, maybe give them human readable name?
SearchExampleClicked("js_alert_calls")
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'm going to avoid this for now, since examples can change down the line, and a naming convention for each could be imprecise. We pass URLs for other events so it's not an uncommon thing to see in our codebase. @ebrodymoore any objections here?
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.
No objections from me. Thanks @attfarhan
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.
Seems good to me. Left a minor comment on reporting urls directly in events
@@ -185,11 +185,14 @@ export const RepogroupPage: React.FunctionComponent<RepogroupPageProps> = (props | |||
) | |||
} | |||
|
|||
const RepoLinkClicked = (repoName: string) => (): void => |
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.
Plain functions that are not React components should be camelCased (same for other functions)
@@ -64,6 +64,10 @@ interface Props | |||
globbing: boolean | |||
} | |||
|
|||
const SearchExampleClicked = (url: string) => (): void => eventLogger.log('ExampleSearchClicked', { url }) | |||
const LanguageExampleClicked = (language: string) => (): void => |
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.
Instead of currying these functions, you could also just define the function as a closure in the component
Fixes #12356.
Adds 3 event to our logging:
RepogroupPageRepoLinkClicked
event when clicking on repository links on the repogroup pageExampleSearchClicked
when an example search is clicked on the homepageExampleLanguageSearchClicked
when an example language is clicked on the homepage@ebrodymoore do these names suffice or should they be follow a certain format?