Skip to content

Commit

Permalink
KLAVIYO - Mapped total key in klaviyo payload (#745)
Browse files Browse the repository at this point in the history
* added total key

* updated klaviyo version

* removed total from whitelist

* test case if revenue missing

---------

Co-authored-by: Gaurav Kochar <[email protected]>
  • Loading branch information
Innovative-GauravKochar and Gaurav Kochar authored Apr 12, 2023
1 parent 277e940 commit da03368
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion integrations/klaviyo/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ Klaviyo.prototype.orderCompleted = function(track) {
'itemNames',
'items',
'revenue',
'total',
'products'
];
// strip standard props and leave custom props only
Expand Down
2 changes: 1 addition & 1 deletion integrations/klaviyo/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@segment/analytics.js-integration-klaviyo",
"description": "The Klaviyo analytics.js integration.",
"version": "2.2.5",
"version": "2.2.6",
"keywords": [
"analytics.js",
"analytics.js-integration",
Expand Down
6 changes: 4 additions & 2 deletions integrations/klaviyo/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ describe('Klaviyo', function() {
$value: 25,
Categories: ['Games', 'Interwebs'],
ItemNames: ['Monopoly: 3rd Edition', 'Suh dude'],
total: 30,
Items: [
{
id: '507f1f77bcf86cd799439011',
Expand Down Expand Up @@ -291,6 +292,7 @@ describe('Klaviyo', function() {
$value: 25,
Categories: ['Games'],
ItemNames: ['Monopoly: 3rd Edition'],
total: 30,
Items: [
{
id: '507f1f77bcf86cd799439011',
Expand Down Expand Up @@ -414,7 +416,6 @@ describe('Klaviyo', function() {
letMePass: 'hi',
customProp: true,
total: 30,
revenue: 25,
shipping: 3,
tax: 2,
discount: 2.5,
Expand Down Expand Up @@ -449,9 +450,10 @@ describe('Klaviyo', function() {
'Completed Order',
{
$event_id: '50314b8e9bcf000000000000',
$value: 25,
$value: 30,
Categories: ['Games', 'Interwebs'],
ItemNames: ['Monopoly: 3rd Edition', 'Suh dude'],
total: 30,
Items: [
{
id: '507f1f77bcf86cd799439011',
Expand Down

0 comments on commit da03368

Please sign in to comment.