@asayerio/analytics.js-integration-asayer
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -7,14 +7,14 @@ 'use strict' | ||
.global('asayer') | ||
.option('sid', null) | ||
.option('siteId', null) | ||
.tag('<script src="https://static.asayer.io/asayer.js" data-asayer-ns="asayer"></script>') | ||
Asayer.prototype.initialize = function () { | ||
var sid = Number(this.options.sid) | ||
var siteId = Number(this.options.siteId) | ||
if (this.options.sid === null || isNaN(sid)) { | ||
console.warn('Asayer wrong sid option, not loading.') | ||
if (this.options.siteId === null || isNaN(siteId)) { | ||
console.warn('Asayer wrong siteId option, not loading.') | ||
return | ||
} | ||
var r = [sid] | ||
var r = [siteId] | ||
var asayer = window.asayer = { r: r } | ||
@@ -24,2 +24,4 @@ asayer.start = function (v) { r.push([0]) } | ||
asayer.event = function (t, p) { r.push([2, t, p]) } | ||
asayer.id = Function.prototype | ||
asayer.started = function () { return false } | ||
@@ -26,0 +28,0 @@ this.load(this.ready) |
{ | ||
"name": "@asayerio/analytics.js-integration-asayer", | ||
"description": "The Asayer analytics.js integration.", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "analytics.js", |
@@ -26,3 +26,3 @@ 'use strict' | ||
it('should call #load', function () { | ||
asayer = new Asayer({ 'sid': '1234' }) | ||
asayer = new Asayer({ 'siteId': '1234' }) | ||
analytics.use(Asayer) | ||
@@ -35,4 +35,4 @@ analytics.add(asayer) | ||
it('should not call #load for wrong sid', function () { | ||
asayer = new Asayer({ 'sid': 'wrong' }) | ||
it('should not call #load for wrong siteId', function () { | ||
asayer = new Asayer({ 'siteId': 'wrong' }) | ||
analytics.use(Asayer) | ||
@@ -48,3 +48,3 @@ analytics.add(asayer) | ||
beforeEach(function (done) { | ||
asayer = new Asayer({ 'sid': '1234' }) | ||
asayer = new Asayer({ 'siteId': '1234' }) | ||
analytics.use(Asayer) | ||
@@ -51,0 +51,0 @@ analytics.add(asayer) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10906
217