Commit 31d57a21 authored by Mike Greiling's avatar Mike Greiling

Merge branch '7244-snowplow-is-not-loading-correctly-sp-js' into 'master'

Resolve "Snowplow is not loading correctly (sp.js)"

Closes #7244

See merge request gitlab-org/gitlab-ee!6899
parents 885097de b2f0a33f
...@@ -170,6 +170,7 @@ module Gitlab ...@@ -170,6 +170,7 @@ module Gitlab
%w[images javascripts stylesheets].each do |path| %w[images javascripts stylesheets].each do |path|
config.assets.paths << "#{config.root}/ee/app/assets/#{path}" config.assets.paths << "#{config.root}/ee/app/assets/#{path}"
end end
config.assets.precompile << "shared/snowplow/sp.js"
# Compile non-JS/CSS assets in the ee/app/assets folder by default # Compile non-JS/CSS assets in the ee/app/assets folder by default
# Mimic sprockets-rails default: https://github.com/rails/sprockets-rails/blob/v3.2.1/lib/sprockets/railtie.rb#L84-L87 # Mimic sprockets-rails default: https://github.com/rails/sprockets-rails/blob/v3.2.1/lib/sprockets/railtie.rb#L84-L87
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[]; ;(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.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; };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('/assets/shared/snowplow/sp.js')}","snowplow")); n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","#{asset_url('shared/snowplow/sp.js')}","snowplow"));
window.snowplow('newTracker', 'cf', '#{Gitlab::CurrentSettings.snowplow_collector_uri}', { window.snowplow('newTracker', 'cf', '#{Gitlab::CurrentSettings.snowplow_collector_uri}', {
appId: '#{Gitlab::CurrentSettings.snowplow_site_id}', appId: '#{Gitlab::CurrentSettings.snowplow_site_id}',
......
title: Corrected URL for snowplow client side JS
merge_request: 6899
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment