Skip to content
This repository has been archived by the owner on Aug 18, 2023. It is now read-only.

track events don't get tracked - missing properties in documentation #30

Closed
leonardlin opened this issue Sep 12, 2021 · 1 comment
Closed

Comments

@leonardlin
Copy link

Following the documentation I tried to track an event, but nothing showed up in Klaviyo UI.

// Track a user's behavior - create an event in Klaviyo
KlaviyoClient.public.track({
event: 'Ordered Pizza',
email: 'pizza.dave@mailinator.com',
properties: {
items: [
{
size: 'Large',
toppings: [
'Pepperoni',
'Onions',
'Smoked Gouda'
],
price: 23.99
}
],
$value: 23.99
},
customerProperties: {
likesOnions: true
},
timestamp: 1532806824
});

Merging it with the documentation about API here:
https://help.klaviyo.com/hc/en-us/articles/360038562411-Setting-Up-API-based-Website-Activity-Events#server-side-requests2

I had to modify the event call for the event to work:

  • add customer_properties.$email
  • fix field-name customerProperties -> customer_properties
  • fix field-name timestamp -> time

// adjusted version that works
KlaviyoClient.public.track({
event: 'Ordered Pizza',
email: 'pizza.dave@mailinator.com',
customer_properties: {
$email: 'pizza.dave@mailinator.com',
}.
properties: {
items: [
{
size: 'Large',
toppings: [
'Pepperoni',
'Onions',
'Smoked Gouda'
],
price: 23.99
}
],
$value: 23.99
},
time: 1532806824
});

@njparadis
Copy link
Contributor

Tested this on the latest release (1.1.3) and was unable to reproduce:
image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants