@akhouad not sure if this helps (i'm not a developer). but as far as I can see the shopify checkout started events are pushed serverside (if I'm right) not front-end side. isn't _learn.push a frontend solution?
https://help.klaviyo.com/hc/en-us/articles/115005082927-Integrate-a-Standard-Ecommerce-Platform#started-checkout5
https://help.klaviyo.com/hc/en-us/articles/360031078492-Custom-Integration-FAQ
That being said if the klaviyo.js is loaded this should send an event to Klaviyo.
For tracking in the checkout I would advise to use serverside solutions (see links above).
Thank you for your reply, I can see in the second article you sent that they’re supported in both front-end and backend.
‘ Our Track and Identify APIs have both server-side and front-end (JavaScript) components. ‘
Another thing you could test is sending it manually and see what (if any) error you get.
Also check the https://www.klaviyo.com/dashboard/activity dashboard to make sure the events are not coming in maybe under another name?
Hey @akhouad it looks like you’re trying to use the server side method and then passing that into the _learnq object. You could do 1 of the following:
// cookie the user
_learnq.push(u'identify', {$email: email}])
const data = {
'Total Price': price,
'Line Items': line_item
}
// track the event
_learnq.push(u'track', 'Started Checkout', data])
// send using ajax
const data = {
'token': token,
'event': 'Started Checkout',
'customer_properties': {
'$email': email
},
'properties': {
'Total Price': price,
'Line Items': line_item
}
}
$.get('https://a.klaviyo.com/api/identify?data=' + btoa(JSON.stringify(data)))
If you utilize the _learnq module then you will need to have klaviyo.js installed on the site.
Let me know if you have any questions!