Add Snowplow tracking to the user menu
We need to add snowplow tracking to the new user menu to match the tracking on the old user menu.
The fields we need to send are, Category, Action, Label, and Property.
- Category: The page the user is currently on.
- Action: The action taken. For most of these, this will be
click_link
- Label: What items was clicked on. This needs to match the label in the old navigation.
- Property: This will be
nav_user_menu
E.g. clicking on the "Edit profile" link in the old user menu when on an MR page sends the following data:
Event Category : projects:merge_requests:show
Event Action : click_link
Event Label : user_edit_profile
Event Property : navigation_top
Doing the same with the new navigation should send:
Event Category : projects:merge_requests:show
Event Action : click_link
Event Label : user_edit_profile
Event Property : nav_user_menu
You can test these using the Snowplow chrome extension.
Note: To test this locally, you will need to enable Snowplow in your GDK.
This can all be done with data attributes. See !115877 (merged) for an example.
Edited by Sam Beckham