summaryrefslogtreecommitdiff
path: root/app/controllers/concerns/redis_tracking.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/concerns/redis_tracking.rb')
-rw-r--r--app/controllers/concerns/redis_tracking.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/app/controllers/concerns/redis_tracking.rb b/app/controllers/concerns/redis_tracking.rb
index 3155208f47c..c1135d2f759 100644
--- a/app/controllers/concerns/redis_tracking.rb
+++ b/app/controllers/concerns/redis_tracking.rb
@@ -12,12 +12,13 @@
# You can also pass custom conditions using `if:`, using the same format as with Rails callbacks.
# You can also pass an optional block that calculates and returns a custom id to track.
module RedisTracking
+ include Gitlab::Tracking::Helpers
extend ActiveSupport::Concern
class_methods do
def track_redis_hll_event(*controller_actions, name:, if: nil, &block)
custom_conditions = Array.wrap(binding.local_variable_get('if'))
- conditions = [:trackable_request?, *custom_conditions]
+ conditions = [:trackable_html_request?, *custom_conditions]
after_action only: controller_actions, if: conditions do
track_unique_redis_hll_event(name, &block)
@@ -37,10 +38,6 @@ module RedisTracking
Gitlab::UsageDataCounters::HLLRedisCounter.track_event(event_name, values: unique_id)
end
- def trackable_request?
- request.format.html? && request.headers['DNT'] != '1'
- end
-
def visitor_id
return cookies[:visitor_id] if cookies[:visitor_id].present?
return unless current_user