Skip to content

Prevent incorrect usage of `tracking_attrs` helper

What does this MR do and why?

Related to #348968 (closed)

On !76305 (comment 784820865) we discussed how to merge data-attributes with the tracking_attrs helper, and we introduced a new tracking_attrs_data. This MR:

  • Removes unneeded Rails.env.production? guard.
  • Adds documentation for tracking_attrs_data variant.
  • Updates related specs.

Screenshots or screen recordings

No visual changes.

How to set up and validate locally

  1. Follow the instructions in our docs to enable Snowplow locally if you haven't done so.
  2. Trigger any Snowplow event using the helper. Like clicking the GitLab logo on the main navigation.
  3. Verify the Snowplow testing tool of your choice, and you'll be able to see the proper data.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Axel García

Merge request reports