Skip to content

Commit 993bd1a

Browse files
committed
feat: add navigation submenu tracking events
Adds two new events for tracking navigation submenu interactions: navigationSubmenuViewed - fires when submenu is displayed { action: "navigationSubmenuViewed", context_module: "header", context_page_owner_type: "home", navigation_item: "Artists", interaction_type: "hover" } clickedNavigationSubmenuItem - fires when submenu item is clicked { action: "clickedNavigationSubmenuItem", context_module: "header", context_page_owner_type: "home", parent_navigation_item: "Artists", submenu_group: "Blue-Chip Artists", submenu_item: "Banksy", destination_path: "/artist/banksy" }
1 parent fc825e2 commit 993bd1a

File tree

3 files changed

+95
-0
lines changed

3 files changed

+95
-0
lines changed

src/Schema/Events/Click.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,3 +2698,47 @@ export interface ClickedHeader {
26982698
context_page_owner_type: PageOwnerType
26992699
subject: string
27002700
}
2701+
2702+
/**
2703+
* User clicks an item within a navigation submenu 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 [[ClickedNavigationSubmenuItem]]
2708+
*
2709+
* @example Desktop - clicking "Banksy" from the Blue-Chip Artists group:
2710+
* ```
2711+
* {
2712+
* action: "clickedNavigationSubmenuItem",
2713+
* context_module: "header",
2714+
* context_page_owner_type: "home",
2715+
* parent_navigation_item: "Artists",
2716+
* submenu_group: "Blue-Chip Artists",
2717+
* submenu_item: "Banksy",
2718+
* destination_path: "/artist/banksy"
2719+
* }
2720+
* ```
2721+
*
2722+
* @example Desktop - clicking "View All Artists":
2723+
* ```
2724+
* {
2725+
* action: "clickedNavigationSubmenuItem",
2726+
* context_module: "header",
2727+
* context_page_owner_type: "home",
2728+
* parent_navigation_item: "Artists",
2729+
* submenu_item: "View All Artists",
2730+
* destination_path: "/artists"
2731+
* }
2732+
* ```
2733+
*/
2734+
export interface ClickedNavigationSubmenuItem {
2735+
action: ActionType.clickedNavigationSubmenuItem
2736+
context_module: ContextModule
2737+
context_page_owner_type: PageOwnerType
2738+
context_page_owner_id?: string
2739+
context_page_owner_slug?: string
2740+
parent_navigation_item: string
2741+
submenu_group?: string
2742+
submenu_item: string
2743+
destination_path: string
2744+
}

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 submenu 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 [[NavigationSubmenuViewed]].
560+
*
561+
* @example Desktop hover:
562+
* ```
563+
* {
564+
* action: "navigationSubmenuViewed",
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: "navigationSubmenuViewed",
576+
* context_module: "header",
577+
* context_page_owner_type: "artist",
578+
* navigation_item: "Artists",
579+
* interaction_type: "drilldown"
580+
* }
581+
* ```
582+
*/
583+
export interface NavigationSubmenuViewed {
584+
action: ActionType.navigationSubmenuViewed
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: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ import {
8888
ClickedMarkSold,
8989
ClickedMarkSpam,
9090
ClickedNavBar,
91+
ClickedNavigationSubmenuItem,
9192
ClickedNavigationTab,
9293
ClickedOfferActions,
9394
ClickedOfferOption,
@@ -187,6 +188,7 @@ import {
187188
ImmersiveViewArtworkDisplayed,
188189
ImmersiveViewOptionViewed,
189190
ItemViewed,
191+
NavigationSubmenuViewed,
190192
OrderDetailsViewed,
191193
OrderProgressionViewed,
192194
ProgressiveOnboardingTooltipViewed,
@@ -381,6 +383,7 @@ export type Event =
381383
| ClickedMarkSpam
382384
| ClickedNavBar
383385
| ClickedNavigationTab
386+
| ClickedNavigationSubmenuItem
384387
| ClickedNotificationsBell
385388
| ClickedOfferActions
386389
| ClickedOfferOption
@@ -460,6 +463,7 @@ export type Event =
460463
| ItemViewed
461464
| MaxBidSelected
462465
| MyCollectionOnboardingCompleted
466+
| NavigationSubmenuViewed
463467
| OnboardingUserInputData
464468
| OrderDetailsViewed
465469
| OrderProgressionViewed
@@ -854,6 +858,10 @@ export enum ActionType {
854858
* Corresponds to {@link ClickedNavigationTab}
855859
*/
856860
clickedNavigationTab = "clickedNavigationTab",
861+
/**
862+
* Corresponds to {@link ClickedNavigationSubmenuItem}
863+
*/
864+
clickedNavigationSubmenuItem = "clickedNavigationSubmenuItem",
857865
/**
858866
* Corresponds to {@link ClickedNotificationsBell}
859867
*/
@@ -1263,6 +1271,10 @@ export enum ActionType {
12631271
* Corresponds to {@link MyCollectionOnboardingCompleted}
12641272
*/
12651273
myCollectionOnboardingCompleted = "myCollectionOnboardingCompleted",
1274+
/**
1275+
* Corresponds to {@link NavigationSubmenuViewed}
1276+
*/
1277+
navigationSubmenuViewed = "navigationSubmenuViewed",
12661278
/**
12671279
* Corresponds to {@link OnboardingUserInputData}
12681280
*/

0 commit comments

Comments
 (0)