2019-09-04 21:01:54 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module TrackingHelper
|
|
|
|
def tracking_attrs(label, event, property)
|
2019-10-12 21:52:04 +05:30
|
|
|
return {} unless tracking_enabled?
|
|
|
|
|
|
|
|
{
|
|
|
|
data: {
|
|
|
|
track_label: label,
|
|
|
|
track_event: event,
|
|
|
|
track_property: property
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def tracking_enabled?
|
|
|
|
Rails.env.production? &&
|
|
|
|
::Gitlab::CurrentSettings.snowplow_enabled?
|
2019-09-04 21:01:54 +05:30
|
|
|
end
|
|
|
|
end
|