Skip to content

Commit 5fb0e87

Browse files
authored
adds fix for custom props on track requests (#291)
1 parent e78b90f commit 5fb0e87

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

KlaviyoV3Sdk/KlaviyoV3Api.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,15 +432,18 @@ public function buildCustomerProperties($customerProperties)
432432

433433
$data = array(
434434
self::TYPE_KEY_PAYLOAD => self::PROFILE_KEY_PAYLOAD,
435-
self::ATTRIBUTE_KEY_PAYLOAD => $kl_properties,
436-
self::PROPERTIES => $customerProperties,
435+
self::ATTRIBUTE_KEY_PAYLOAD => $kl_properties
437436
);
438437

439438
if (isset($customerProperties['$id'])) {
440439
$data[self::ID_KEY_PAYLOAD] = $customerProperties['$id'];
441440
unset($customerProperties['$id']);
442441
}
443442

443+
if(!empty($customerProperties)) {
444+
$data[self::ATTRIBUTE_KEY_PAYLOAD][self::PROPERTIES] = $customerProperties;
445+
}
446+
444447
return array(
445448
self::PROFILE_KEY_PAYLOAD => array(
446449
self::DATA_KEY_PAYLOAD => $data

0 commit comments

Comments
 (0)