Skip to content

Commit 94e83db

Browse files
committed
Added backward compatibility with old _snaq queue
1 parent 63c2561 commit 94e83db

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Passed tracker namespace through to collector in Tracker Protocol (#126)
2020
Moved to argmap-style tracker creation with 'newTracker' (#132)
2121
Added support for cookie namespacing (#131) (TODO)
2222
Added new tag which allows queue to be renamed (#130) (TODO)
23+
Added event vendor parameter sent through on querystring (#138)
2324

2425
Version 1.0.3 (2014-06-27)
2526
--------------------------

src/js/in_queue.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
* TODO: remove this in 2.1.0
8484
*/
8585
function legacyCreateNewNamespace(f, endpoint, namespace) {
86-
helpers.warn(f, 'is deprecated.'); //TODO: more instructions for switching
86+
helpers.warn(f + ' is deprecated.'); //TODO: more instructions for switching
8787

8888
var name;
8989

src/js/init.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,16 @@
3737
/*
3838
* Get the name of the global input function
3939
*/
40-
function getAsynchronousQueue() {
41-
var queueName = window['GlobalSnowplowNamespace'].shift();
42-
var queue = window[queueName];
43-
return queue;
44-
}
4540

4641
var snowplow = require('./snowplow'),
47-
queue = getAsynchronousQueue();
42+
queueName,
43+
queue;
4844

49-
queue.q = new snowplow.Snowplow(queue.q);
45+
if (window.GlobalSnowplowNamespace && window.GlobalSnowplowNamespace.length > 0) {
46+
queueName = window.GlobalSnowplowNamespace.shift();
47+
queue = window[queueName];
48+
queue.q = new snowplow.Snowplow(queue.q);
49+
} else {
50+
window._snaq = window._snaq || [];
51+
window._snaq = new snowplow.Snowplow(window._snaq);
52+
}

0 commit comments

Comments
 (0)