Skip to content

Commit 13d5858

Browse files
committed
Add navigation dropdown tracking events
Adds two new events for tracking navigation dropdown interactions: navigationDropdownViewed - fires when dropdown is displayed { action: "navigationDropdownViewed", context_module: "header", context_page_owner_type: "home", navigation_item: "Artists", interaction_type: "hover" } ClickedNavigationDropdownItem - typed interface for dropdown clicks { action: "click", flow: "Header", context_module: "HeaderArtworksDropdown", context_page_owner_type: "home", parent_navigation_item: "Artworks", dropdown_group: "Blue-Chip Artists", subject: "Banksy", destination_path: "/artist/banksy" }
1 parent fc825e2 commit 13d5858

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed

src/Schema/Events/Click.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,3 +2698,50 @@ export interface ClickedHeader {
26982698
context_page_owner_type: PageOwnerType
26992699
subject: string
27002700
}
2701+
2702+
/**
2703+
* User clicks an item within a navigation dropdown on web (desktop or mobile)
2704+
* Triggered before navigation to the destination
2705+
* Note: Clicks on actual items (e.g., "Banksy"), not category headings (e.g., "Blue-Chip Artists")
2706+
*
2707+
* This schema describes events sent to Segment from [[ClickedNavigationDropdownItem]]
2708+
*
2709+
* @example Desktop - clicking "Banksy" from the Blue-Chip Artists group:
2710+
* ```
2711+
* {
2712+
* action: "click",
2713+
* flow: "Header",
2714+
* context_module: "HeaderArtworksDropdown",
2715+
* context_page_owner_type: "home",
2716+
* parent_navigation_item: "Artworks",
2717+
* dropdown_group: "Blue-Chip Artists",
2718+
* subject: "Banksy",
2719+
* destination_path: "/artist/banksy"
2720+
* }
2721+
* ```
2722+
*
2723+
* @example Desktop - clicking "View All Artists":
2724+
* ```
2725+
* {
2726+
* action: "click",
2727+
* flow: "Header",
2728+
* context_module: "HeaderArtistsDropdown",
2729+
* context_page_owner_type: "home",
2730+
* parent_navigation_item: "Artists",
2731+
* subject: "View All Artists",
2732+
* destination_path: "/artists"
2733+
* }
2734+
* ```
2735+
*/
2736+
export interface ClickedNavigationDropdownItem {
2737+
action: "click"
2738+
flow: string
2739+
context_module: ContextModule
2740+
context_page_owner_type: PageOwnerType
2741+
context_page_owner_id?: string
2742+
context_page_owner_slug?: string
2743+
parent_navigation_item: string
2744+
dropdown_group?: string
2745+
subject: string
2746+
destination_path: string
2747+
}

src/Schema/Events/ImpressionTracking.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,3 +550,42 @@ export interface ImmersiveViewArtworkDisplayed {
550550
context_page_owner_id?: string
551551
artwork_id: string
552552
}
553+
554+
/**
555+
* User views a navigation dropdown on web
556+
* - Desktop: triggered after hovering over a top-level nav item (e.g., "Artists") with delay
557+
* - Mobile web: triggered when drilling down into the navigation menu hierarchy
558+
*
559+
* This schema describes events sent to Segment from [[NavigationDropdownViewed]].
560+
*
561+
* @example Desktop hover:
562+
* ```
563+
* {
564+
* action: "navigationDropdownViewed",
565+
* context_module: "header",
566+
* context_page_owner_type: "home",
567+
* navigation_item: "Artists",
568+
* interaction_type: "hover"
569+
* }
570+
* ```
571+
*
572+
* @example Mobile web drilldown:
573+
* ```
574+
* {
575+
* action: "navigationDropdownViewed",
576+
* context_module: "header",
577+
* context_page_owner_type: "artist",
578+
* navigation_item: "Artists",
579+
* interaction_type: "drilldown"
580+
* }
581+
* ```
582+
*/
583+
export interface NavigationDropdownViewed {
584+
action: ActionType.navigationDropdownViewed
585+
context_module: ContextModule
586+
context_page_owner_type: PageOwnerType
587+
context_page_owner_id?: string
588+
context_page_owner_slug?: string
589+
navigation_item: string
590+
interaction_type: "hover" | "drilldown"
591+
}

src/Schema/Events/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ import {
187187
ImmersiveViewArtworkDisplayed,
188188
ImmersiveViewOptionViewed,
189189
ItemViewed,
190+
NavigationDropdownViewed,
190191
OrderDetailsViewed,
191192
OrderProgressionViewed,
192193
ProgressiveOnboardingTooltipViewed,
@@ -460,6 +461,7 @@ export type Event =
460461
| ItemViewed
461462
| MaxBidSelected
462463
| MyCollectionOnboardingCompleted
464+
| NavigationDropdownViewed
463465
| OnboardingUserInputData
464466
| OrderDetailsViewed
465467
| OrderProgressionViewed
@@ -1263,6 +1265,10 @@ export enum ActionType {
12631265
* Corresponds to {@link MyCollectionOnboardingCompleted}
12641266
*/
12651267
myCollectionOnboardingCompleted = "myCollectionOnboardingCompleted",
1268+
/**
1269+
* Corresponds to {@link NavigationDropdownViewed}
1270+
*/
1271+
navigationDropdownViewed = "navigationDropdownViewed",
12661272
/**
12671273
* Corresponds to {@link OnboardingUserInputData}
12681274
*/

0 commit comments

Comments
 (0)