Solved

JavaScript Track for Placed Order event?

  • 20 July 2021
  • 2 replies
  • 165 views

Badge

Hello,

I’m tracking some events on my site build on old laravel 5. But I’m having problems with the API for events like “Placed Order”. Anyone has integrated the Github “klaviyo / php-klaviyo” with Laravel 5? Or is it possible to track this kind of events using Javascript?

Thanks!

icon

Best answer by Dov 21 July 2021, 16:27

View original

2 replies

Userlevel 4
Badge +3

@MarcPartsss If you are using our onsite javascript, you can use _learnq to record custom Track events.

https://help.klaviyo.com/hc/en-us/articles/115000751052-Track-and-Identify-API-Reference#tracking-events--javascript-9

 

 

Userlevel 6
Badge +5

Hi @MarcPartsss,

Thanks for sharing your question with the Community.

In addition to @jallain’s comment, you would be welcome to create a custom integration in your account. Adding a Custom eCommerce Integration is possible via our API. We have both Javascript and server-side endpoints for our Track (for sending events) and Identify (for sending profile properties) APIs.

We recommend sending orders via our server-side API because it avoids a couple of use-cases in which front-end order tracking would not work:

1) if someone is using a javascript-blocking plugin

2) if someone is on a slow computer and javascript does not load in time on their checkout page

The standard setup for ecommerce platforms that do not provide access to server-side code would be to set up an intermediary server that collects the last 5-20 minutes of orders and sends them to us as server-side Track API calls. This ensures all of the order data is complete and bypasses any potential front-end issues. If this is not an option, you can absolutely send us order information via Javascript Track calls with the caveats listed above.

Here's some more specific information on our server-side and Javascript APIs:

Javascript Track API

Javascript Identify API

Server-side Track API

Server-side Identify API

Reply