2019-08-14 19:21:58 +00:00
|
|
|
- return unless Gitlab::CurrentSettings.snowplow_enabled?
|
|
|
|
|
2020-11-26 18:09:18 +00:00
|
|
|
= javascript_tag do
|
2019-08-14 19:21:58 +00:00
|
|
|
:plain
|
|
|
|
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
|
|
|
|
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
|
|
|
|
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
|
|
|
|
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","#{asset_url('snowplow/sp.js')}","snowplow"));
|
|
|
|
|
2019-10-24 21:06:26 +00:00
|
|
|
window.snowplowOptions = #{Gitlab::Tracking.snowplow_options(@group).to_json}
|
2021-02-22 15:10:48 +00:00
|
|
|
|
|
|
|
gl = window.gl || {};
|
|
|
|
gl.snowplowStandardContext = #{Gitlab::Tracking::StandardContext.new.to_context.to_json.to_json}
|