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