Class: ProductAnalytics::Tracker

Inherits:
Object
  • Object
show all
Extended by:
Gitlab::Utils::StrongMemoize
Defined in:
lib/product_analytics/tracker.rb

Constant Summary collapse

URL =

The file is located in the /public directory

Gitlab.config.gitlab.url + '/-/sp.js'
COLLECTOR_URL =

The collector URL minus protocol and /i

Gitlab.config.gitlab.url.sub(/\Ahttps?\:\/\//, '') + '/-/collector'

Class Method Summary collapse

Methods included from Gitlab::Utils::StrongMemoize

clear_memoization, strong_memoize, strong_memoized?

Class Method Details

.event(category, action, label: nil, property: nil, value: nil, context: nil) ⇒ Object


14
15
16
17
18
# File 'lib/product_analytics/tracker.rb', line 14

def event(category, action, label: nil, property: nil, value: nil, context: nil)
  return unless enabled?

  snowplow.track_struct_event(category, action, label, property, value, context, (Time.now.to_f * 1000).to_i)
end