@segment/analytics.js-integration-amplitude
Advanced tools
Comparing version 3.0.1 to 3.1.0
@@ -0,1 +1,5 @@ | ||
# 3.1.0 / 2019-08-09 | ||
- Add mapping of non-property fields to event_props. | ||
# 3.0.0 / 2019-06-10 | ||
@@ -2,0 +6,0 @@ |
@@ -52,2 +52,3 @@ 'use strict'; | ||
.option('traitsToIncrement', []) | ||
.option('appendFieldsToEventProps', {}) | ||
.tag('<script src="' + src + '">')); | ||
@@ -257,2 +258,7 @@ | ||
// Append extra fields to event_props | ||
each(function(prop, field) { | ||
props[prop] = track.proxy(field); | ||
}, this.options.appendFieldsToEventProps); | ||
// track the event | ||
@@ -259,0 +265,0 @@ if (options.groups) { |
{ | ||
"name": "@segment/analytics.js-integration-amplitude", | ||
"description": "The Amplitude analytics.js integration.", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"keywords": [ | ||
@@ -53,3 +53,3 @@ "analytics.js", | ||
}, | ||
"gitHead": "98db2e118e9764cc61a88e17357e686c640d31a2" | ||
"gitHead": "a582549646b9c88bb628cdb78e9a7d4519589604" | ||
} |
@@ -67,2 +67,3 @@ 'use strict'; | ||
.option('deviceIdFromUrlParam', false) | ||
.option('appendFieldsToEventProps', {}) | ||
); | ||
@@ -637,2 +638,14 @@ }); | ||
}); | ||
it('should send an event with context properties mapped', function() { | ||
amplitude.options.appendFieldsToEventProps = { | ||
'context.page.path': 'pagePath' | ||
}; | ||
analytics.track('event', { foo: 'bar' }); | ||
analytics.called(window.amplitude.getInstance().logEvent, 'event', { | ||
foo: 'bar', | ||
pagePath: '/context.html' | ||
}); | ||
}); | ||
}); | ||
@@ -639,0 +652,0 @@ |
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
50281
1176