Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Support "Completed Order" #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ Optimizely.prototype.track = function(track) {

// Optimizely expects revenue only passed through Order Completed events
if (eventProperties.revenue && opts.sendRevenueOnlyForOrderCompleted) {
if (track.event() === 'Order Completed') {
if (track.event() === 'Order Completed' || track.event() === 'Completed Order') {
eventProperties.revenue = Math.round(eventProperties.revenue * 100);
} else if (track.event() !== 'Order Completed') {
} else {
delete eventProperties.revenue;
}
// This is legacy Segment-Optimizely behavior,
Expand Down