2019-06-05 12:28:41 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module TrackingHelper
|
2021-03-26 14:09:16 -04:00
|
|
|
def tracking_attrs(label, action, property)
|
2022-05-12 17:09:08 -04:00
|
|
|
return {} unless ::Gitlab::Tracking.enabled?
|
2019-08-14 15:21:58 -04:00
|
|
|
|
|
|
|
{
|
|
|
|
data: {
|
|
|
|
track_label: label,
|
2021-03-26 14:09:16 -04:00
|
|
|
track_action: action,
|
2019-08-14 15:21:58 -04:00
|
|
|
track_property: property
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
2021-12-22 01:13:39 -05:00
|
|
|
def tracking_attrs_data(label, action, property)
|
|
|
|
tracking_attrs(label, action, property).fetch(:data, {})
|
|
|
|
end
|
2019-06-05 12:28:41 -04:00
|
|
|
end
|