2021-09-30 23:02:18 +05:30
|
|
|
- return unless Gitlab::Tracking.enabled?
|
2019-10-12 21:52:04 +05:30
|
|
|
|
2021-02-22 17:27:13 +05:30
|
|
|
= javascript_tag do
|
2019-10-12 21:52:04 +05:30
|
|
|
: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"));
|
|
|
|
|
2021-11-11 11:23:49 +05:30
|
|
|
window.snowplowOptions = #{Gitlab::Tracking.options(@group).to_json}
|
2021-04-17 20:07:23 +05:30
|
|
|
|
|
|
|
gl = window.gl || {};
|
2021-12-11 22:18:48 +05:30
|
|
|
gl.snowplowStandardContext = #{Gitlab::Tracking::StandardContext.new(namespace: @group || @project&.namespace,
|
|
|
|
project: @project, user: current_user).to_context.to_json.to_json}
|
2021-11-11 11:23:49 +05:30
|
|
|
gl.snowplowPseudonymizedPageUrl = #{masked_page_url.to_json};
|