Skip to content
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

Merged
merged 3 commits into from
Oct 28, 2020
Merged

DOP-1673: Add Segment analytics to Breadcrumbs #308

merged 3 commits into from
Oct 28, 2020

Conversation

mango-db
Copy link
Contributor

DOP-1673. Datalake. Manual.

Bonus: Issue referenced in comment is fixed. Remove comment.

onClick={() => {
reportAnalytics('BreadcrumbClick', {
areaFrom: 'Breadcrumb',
parentPaths: parentPaths,
Copy link

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?

Copy link
Contributor Author

@mango-db mango-db Oct 26, 2020

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'

Copy link
Contributor Author

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!

Copy link

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.

Copy link
Contributor Author

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.

Copy link

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

Copy link
Member

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.

@mango-db mango-db requested a review from eshwer October 26, 2020 20:17
@mango-db mango-db merged commit f70fcaf into master Oct 28, 2020
@mango-db mango-db deleted the DOP-1673 branch October 28, 2020 20:11
graysonhicks pushed a commit that referenced this pull request Jan 20, 2023
* DOP-1673: Add Segment analytics to Breadcrumbs

* DOP-1673: remove areaFrom key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants