Solved

Adding Custom Property in Place Order Event

  • 10 June 2024
  • 5 replies
  • 73 views

Badge

In email template I’m reading data from Profile and Place Order Events. Now I’m looking for a way to add some custom data in both , I was able to update profile using {{baseUrl}}/api/profiles/:id/ api but couldn't find any way for Place Order . I’m using Magento 2 with Klaviyo , Any suggestion and answers would be appreciated. 

Thanks 

icon

Best answer by saulblum 11 June 2024, 15:52

View original

5 replies

Userlevel 5
Badge +7

Hi! You can’t edit the properties sent with the M2 integration’s Placed Order event; they are set by the integration. You also can’t update an event’s properties once the event has been sent.

You can use the Create Event call — https://developers.klaviyo.com/en/reference/create_event — to send custom events to profiles, with whatever custom properties you want.

What custom event properties, that aren’t being sent by the M2 integration, would you want?

Badge

@saulblum I want to add a custom event property in the event. for sake of example I want to send TimeOfday and send Good Morning or  Good Evening and use it in Email Template {{TimeOfday }} . 

Userlevel 5
Badge +7

As I’d said, you can’t update properties of events already sent to a profile. Presumably the event already has a property for order date/time?

Badge

As I’d said, you can’t update properties of events already sent to a profile. Presumably the event already has a property for order date/time?

Is there a way i can intercept and add my custom property to it?

Userlevel 5
Badge +7

Not the Magento 2 “Placed Order” events and other events coming from the integration. You could have a Klaviyo flow triggered on this event that uses a webhook to call Klaviyo’s API to send a new event, with additional properties. Or see if Magento 2 has webhooks where you can send custom events to Klaviyo.

Reply