Commit 8fa80713 authored by Mike Greiling's avatar Mike Greiling

Merge branch...

Merge branch '8432-switch-snowplow-storage-strategy-back-to-localstorage-pending-upstream-fix' into 'master'

Resolve "Switch snowplow storage strategy back to localStorage pending upstream fix"

Closes #8432

See merge request gitlab-org/gitlab-ee!9223
parents a18f0ba4 c037c4eb
...@@ -11,5 +11,3 @@ ...@@ -11,5 +11,3 @@
/vendor/ /vendor/
karma.config.js karma.config.js
webpack.config.js webpack.config.js
ee/app/assets/javascripts/shared/snowplow/sp.js
...@@ -175,7 +175,9 @@ module Gitlab ...@@ -175,7 +175,9 @@ 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"
config.assets.paths << "#{config.root}/vendor/assets/javascripts/"
config.assets.precompile << "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
......
This diff is collapsed.
...@@ -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('shared/snowplow/sp.js')}","snowplow")); n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","#{asset_url('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}',
...@@ -14,9 +14,8 @@ ...@@ -14,9 +14,8 @@
post: true, post: true,
contexts: { contexts: {
webPage: true, webPage: true,
} },
// Uncomment in https://gitlab.com/gitlab-org/gitlab-ee/issues/8432 stateStorageStrategy: "localStorage"
// stateStorageStrategy: "localStorage"
}); });
window.snowplow('enableActivityTracking', 30, 30); window.snowplow('enableActivityTracking', 30, 30);
......
...@@ -73,7 +73,7 @@ describe 'layouts/_head' do ...@@ -73,7 +73,7 @@ describe 'layouts/_head' do
it 'add a snowplow script tag with asset host' do it 'add a snowplow script tag with asset host' do
render render
expect(rendered).to match('http://test.host/assets/shared/snowplow/') expect(rendered).to match('http://test.host/assets/snowplow/')
expect(rendered).to match('window.snowplow') expect(rendered).to match('window.snowplow')
expect(rendered).to match('www.snow.plow') expect(rendered).to match('www.snow.plow')
end end
......
This diff is collapsed.
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