Skip to content

Commit 54e696a

Browse files
committed
Reinstated line to initialise async queue in the invocation tag
1 parent 0df34c9 commit 54e696a

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

Gruntfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ module.exports = function(grunt) {
136136
},
137137
tag: {
138138
options: {
139-
linebreak: 60
139+
linebreak: 80
140140
},
141141
files: [
142142
{

examples/web/async-medium.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// Load sp.js
2424
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
2525
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
26-
};n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
26+
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
2727
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","../../dist/snowplow.js","new_name_here"));
2828

2929
window.new_name_here('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', {

examples/web/async-small.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// Load sp.js
2424
;(function(p,l,o,w,i,n,g){if(!p[i]){p.GlobalSnowplowNamespace=p.GlobalSnowplowNamespace||[];
2525
p.GlobalSnowplowNamespace.push(i);p[i]=function(){(p[i].q=p[i].q||[]).push(arguments)
26-
};n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
26+
};p[i].q=p[i].q||[];n=l.createElement(o);g=l.getElementsByTagName(o)[0];n.async=1;
2727
n.src=w;g.parentNode.insertBefore(n,g)}}(window,document,"script","../../dist/snowplow.js","snowplow"));
2828

2929
window.snowplow('newTracker', 'cf', 'd3rkrsqld9gmqf.cloudfront.net', { // Initialise a tracker

tags/tag.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,14 @@
5555
// Add the new Snowplow namespace to the global array so sp.js can find it
5656
p['GlobalSnowplowNamespace'].push(i);
5757

58-
// Create the asynchronous queue
58+
// Create the Snowplow function
5959
p[i] = function() {
6060
(p[i].q = p[i].q || []).push(arguments);
6161
};
6262

63+
// Initialise the asynchronous queue
64+
p[i].q = p[i].q || [];
65+
6366
// Create a new script element
6467
n = l.createElement(o);
6568

0 commit comments

Comments
 (0)