@segment/analytics.js-integration-amplitude
Advanced tools
Comparing version 2.94.2 to 2.95.0
@@ -80,3 +80,8 @@ 'use strict'; | ||
.saveParamsReferrerOncePerSession, | ||
deviceIdFromUrlParam: this.options.deviceIdFromUrlParam | ||
deviceIdFromUrlParam: this.options.deviceIdFromUrlParam, | ||
deviceId: | ||
this.options.preferAnonymousIdForDeviceId && | ||
this.analytics && | ||
this.analytics.user() && | ||
this.analytics.user().anonymousId() | ||
}); | ||
@@ -83,0 +88,0 @@ |
{ | ||
"name": "@segment/analytics.js-integration-amplitude", | ||
"description": "The Amplitude analytics.js integration.", | ||
"version": "2.94.2", | ||
"version": "2.95.0", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "analytics.js", |
@@ -28,3 +28,4 @@ 'use strict'; | ||
traitsToIncrement: [], | ||
traitsToSetOnce: [] | ||
traitsToSetOnce: [], | ||
preferAnonymousIdForDeviceId: true | ||
}; | ||
@@ -133,2 +134,3 @@ | ||
); | ||
analytics.assert(config.deviceId === analytics.user().anonymousId()); | ||
}); | ||
@@ -142,2 +144,17 @@ | ||
describe('preferAnonymousIdForDeviceId disabled', function() { | ||
before(function() { | ||
options.preferAnonymousIdForDeviceId = false; | ||
}); | ||
it('should init without anonymousId as the deviceId', function() { | ||
var config = window.amplitude.getInstance().options; | ||
analytics.assert(config.deviceId !== analytics.user().anonymousId()); | ||
}); | ||
after(function() { | ||
options.preferAnonymousIdForDeviceId = true; | ||
}); | ||
}); | ||
describe('#setDeviceId', function() { | ||
@@ -144,0 +161,0 @@ it('should call window.amplitude.setDeviceId', function() { |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
47112
1112
1