Skip to main content

We use the Klaviyo JSON (server side) API on a custom platform for most events that we send in and those are working fine.  I’m trying to add the ‘started checkout’ event, using the Javascript API method.  I feel like I have it set up correctly...I’m not getting any console errors, I’m logged in with a known/established profile that is showing regular api call metrics.  However, I’m not able to see this event in the profile activity nor in the analytics > metrics page.  I’ll provide a few screenshots here...Any ideas on what I’m doing wrong?  Can I set up this event using the same method as our other API calls?

Thanks

 

             Initializer, at bottom of footer

 

Klaviyo Object and event script, on checkout page.

Hi ​@Threeflip09 ,first of all, welcome to the community!

I could be wrong, but I think you have a trailing comma in your ItemNames array here:

You may want to verify that - strange that you’re not getting error responses in your Javascript console.  You may also want to check the Developer Tools → Logs to see if you see any errors there and inspect the request/response details for clues.  

Post back here if you have more questions, or let us know if you solved it!


Thanks for your reply ​@retention

I cleaned up any trailing commas, in our items looping logic (for both the items list and the items arrays).  But I’m still getting the same results (no started checkout metric reporting).  Is there any additional setup inside the Klaviyo account that needs to happen, in order to track this metric?  I ask because I don’t see ‘Started Checkout’ as in the metric filter options in either the Profile page or the Analytics Metric page.  The only place I seee it at all, is if I go to Metrics Mapping.  Does it need to be mapped to ‘Active on Site’, or anything?  

Is there anything else that needs to happen on the website, other than: Fire the initialize script (in Footer w/ public key), fire the Klaviyo Object (currently just before the event script)?  I checked the console logs in both Firefox and Chrome and there is nothing there either.  

Anything else we can do to troubleshoot this?  As I mentioned before, our regular API calls (for creating/updating profiles and tracking placed orders) seems to be working just fine.  This is the first/only Javascript API call that we’ve attempted, so far.

 

Thanks again!


@retention 

I just watched the video on using the JS API.  I’m now thinking the issue is that we probably need to make the identifiy call via JS too. My user was identified via our REST API and there are Klaviyo cookies in local storage, in the browser...Which I assumed was enough to ‘identify’ my profile in the JS call.  

However, I’m now thinking that JS calls probably need to be identified with the JS method, if the user is not coming in through a Klaviyo form or link...Even though our REST calls are going to that profile.  

I’ll try this out a little later.  But if you could confirm whether this needs to happen or not, it might save me some time going down the wrong rabbit hole.

 

Thanks again


@Threeflip09  - Ah right, if you are using the client side version (Javascript) you need to make sure to have the onsite klaviyo.js script. 

You’re probably seen this already, but just in case for future reference, here is the developer doc on it:


@retention Yup, that did the trick!  I’m now seeing the active on site and started checkout events, tracking to the correctly identified Profile.  Thanks for your help here!


Reply