-
Notifications
You must be signed in to change notification settings - Fork 36
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
DOP-1673: Add Segment analytics to Breadcrumbs #308
Conversation
onClick={() => { | ||
reportAnalytics('BreadcrumbClick', { | ||
areaFrom: 'Breadcrumb', | ||
parentPaths: parentPaths, |
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.
Does 'Breadcrumb' return the Breadcrumb they selected? or is that 'path'
And does 'ParentPaths' return the list of breadcrumbs they could have selected?
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.
Supposing the breadcrumbs: 'Java 1' > 'Java 2' > 'Java 3'
. If the user selects 'Java 2'
, Segment will report the following:
areaFrom: 'Breadcrumb',
parentPaths: {
0: 'Java 1',
1: 'Java 2',
2: 'Java 3',
}
breadcrumbClicked: 'Java 2'
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.
You can test for yourself 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.
Oh that's great! I'm not sure if we need the areaFrom: 'Breadcrumb',
in this instance since it will always be "breadcrumb" and the title of the analytics implies its from the breadcrumb. Unless it would make more sense for areaFrom
to return the URL. Either way, I think this will certainly give us what we need to figure out how to do our breadcrumbs in the design.
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 just added it to mirror the 'areaFrom' pattern seen in other Segment tracking -- can certainly remove if desired, just lmk.
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.
Hmm I'll deflect to @sophstad to weigh in here on best practices
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 looks like areaFrom
is used in those cases when the same event is triggered by different components—for example, whether the user clicks on the searchbar in the top nav bar or on the search page.
As such, I don't think it is necessary to include here.
DOP-1673. Datalake. Manual.
Bonus: Issue referenced in comment is fixed. Remove comment.