diff options
Diffstat (limited to 'app/controllers/concerns/product_analytics_tracking.rb')
-rw-r--r-- | app/controllers/concerns/product_analytics_tracking.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/app/controllers/concerns/product_analytics_tracking.rb b/app/controllers/concerns/product_analytics_tracking.rb index 4021ff83578..0b51b3dd380 100644 --- a/app/controllers/concerns/product_analytics_tracking.rb +++ b/app/controllers/concerns/product_analytics_tracking.rb @@ -20,8 +20,17 @@ module ProductAnalyticsTracking def route_events_to(destinations, name, &block) track_unique_redis_hll_event(name, &block) if destinations.include?(:redis_hll) - if destinations.include?(:snowplow) && Feature.enabled?(:route_hll_to_snowplow, tracking_namespace_source) + if destinations.include?(:snowplow) && event_enabled?(name) Gitlab::Tracking.event(self.class.to_s, name, namespace: tracking_namespace_source, user: current_user) end end + + def event_enabled?(event) + events_to_ff = { + g_analytics_valuestream: :route_hll_to_snowplow, + i_search_paid: :route_hll_to_snowplow_phase2 + } + + Feature.enabled?(events_to_ff[event.to_sym], tracking_namespace_source) + end end |