Add Snowplow tracking to pins

We need to add snowplow tracking to pinning to capture the interactions.

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_pin or click_unpin
  • Label: same_as_event_label_for_nav_item
  • Property: This will be nav_project_menu or nav_group_menu

E.g. clicking the 📌 on the "Operate -> Dependency Proxy" on the Group Page or in the Pinned Section of the group page should have:

Event Category : groups:epics:show
Event Action : `click_pin` or `click_unpin`
Event Label : dependency_proxy
Event Property : nav_group

For projects, clicking the 📌 on the "Manage -> Labels" or in the Pinned Section of the project page should have:

Event Category : projects:issues:show
Event Action : `click_pin` or `click_unpin`
Event Label : labels
Event Property : nav_project

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 Christen Dybenko