Skip to content

Commit 17802ca

Browse files
update Parse.ly tracker to config-free tracker (#417)
Co-authored-by: Keith Bourgoin <keith.bourgoin@gmail.com>
1 parent fe4d452 commit 17802ca

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

integrations/parsely/lib/index.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ var Parsely = (module.exports = integration('Parsely')
2121
.option('dynamicTracking', false)
2222
.option('trackEvents', false)
2323
.option('inPixelMetadata', false)
24-
.tag('<script src="//d1z2jf7jlzjs58.cloudfront.net/p.js">'));
24+
.tag(
25+
'<script id="parsely-cfg" src="//cdn.parsely.com/keys/{{ apikey }}/p.js">'
26+
));
2527

2628
/**
2729
* Initialize.
@@ -33,14 +35,6 @@ Parsely.prototype.initialize = function() {
3335
if (this.options.dynamicTracking) window.PARSELY.autotrack = false;
3436
var self = this;
3537

36-
// append the meta tag we need first before JS fires
37-
var meta = document.createElement('meta');
38-
meta.id = 'parsely-cfg';
39-
meta.setAttribute('data-parsely-site', this.options.apiKey);
40-
var head = document.getElementsByTagName('head')[0];
41-
if (!head) return;
42-
head.appendChild(meta);
43-
4438
this.load(function() {
4539
when(self.loaded, self.ready);
4640
});

integrations/parsely/test/index.test.js

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@ describe('Parsely', function() {
5555
analytics.stub(parsely, 'load');
5656
});
5757

58-
it('should create a Parsely meta tag', function() {
59-
var isLoaded = function() {
60-
return !!filter(document.getElementsByTagName('meta'), isParselyMetaTag)
61-
.length;
62-
};
63-
64-
analytics.assert(!isLoaded());
65-
parsely.initialize();
66-
analytics.assert(isLoaded());
67-
});
68-
6958
it('should set window.PARSELY if not already set', function() {
7059
analytics.assert(window.PARSELY === undefined);
7160
analytics.initialize();

0 commit comments

Comments
 (0)