Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions integrations/optimizely/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Optimizely.prototype.track = function(track) {
var payload = {
type: 'event',
eventName: eventName,
tags: eventProperties

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add testing details

properties: eventProperties
};

push(payload);
Expand All @@ -132,7 +132,7 @@ Optimizely.prototype.track = function(track) {
eventName,
userId,
attributes,
payload.tags
payload.properties
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion integrations/optimizely/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@segment/analytics.js-integration-optimizely",
"description": "The Optimizely analytics.js integration.",
"version": "3.5.1",
"version": "3.5.2",
"keywords": [
"analytics.js",
"analytics.js-integration",
Expand Down
30 changes: 15 additions & 15 deletions integrations/optimizely/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ describe('Optimizely', function() {
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'Order Updated',
tags: {}
properties: {}
});
});

Expand All @@ -558,7 +558,7 @@ describe('Optimizely', function() {
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'Order Completed',
tags: {
properties: {
revenue: 999
}
});
Expand All @@ -573,7 +573,7 @@ describe('Optimizely', function() {
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'Checkout Started',
tags: {
properties: {
revenue: 999
}
});
Expand Down Expand Up @@ -830,7 +830,7 @@ describe('Optimizely', function() {
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'Order Updated',
tags: {}
properties: {}
});
});

Expand All @@ -843,7 +843,7 @@ describe('Optimizely', function() {
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'Order Completed',
tags: {
properties: {
revenue: 999
}
});
Expand All @@ -858,7 +858,7 @@ describe('Optimizely', function() {
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'Checkout Started',
tags: {
properties: {
revenue: 999
}
});
Expand Down Expand Up @@ -1075,7 +1075,7 @@ describe('Optimizely', function() {
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'event',
tags: {}
properties: {}
});
});

Expand All @@ -1084,25 +1084,25 @@ describe('Optimizely', function() {
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'event_foo_bar',
tags: {}
properties: {}
});
});

it('should send all additional properties along as tags', function() {
it('should send all additional properties along as properties', function() {
analytics.track('event', { id: 'c00lHa$h', name: 'jerry' });
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'event',
tags: { id: 'c00lHa$h', name: 'jerry' }
properties: { id: 'c00lHa$h', name: 'jerry' }
});
});

it('should change revenue to cents and include in tags', function() {
it('should change revenue to cents and include in properties', function() {
analytics.track('Order Completed', { revenue: 9.99 });
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'Order Completed',
tags: { revenue: 999 }
properties: { revenue: 999 }
});
});

Expand All @@ -1111,7 +1111,7 @@ describe('Optimizely', function() {
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'Order Completed',
tags: { revenue: 53431 }
properties: { revenue: 53431 }
});
});

Expand Down Expand Up @@ -1223,7 +1223,7 @@ describe('Optimizely', function() {
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'Viewed Home Page',
tags: {
properties: {
name: 'Home',
path: '/context.html',
referrer: referrer,
Expand All @@ -1240,7 +1240,7 @@ describe('Optimizely', function() {
analytics.called(window.optimizely.push, {
type: 'event',
eventName: 'Viewed Blog New Integration Page',
tags: {
properties: {
name: 'New Integration',
category: 'Blog',
path: '/context.html',
Expand Down