Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tracking_helper.rb « helpers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 221d9692661adc70a49e510bdc51a26aafd54ffe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module TrackingHelper
  def tracking_attrs(label, event, property)
    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?
  end
end