Skip to main content
Solved

When customer reaches "Order Taken" page how do we push a custom variable into Klaviyo?

  • February 9, 2023
  • 1 reply
  • 36 views

Forum|alt.badge.img+3

We’re running Klaviyo on a WooCommerce site.  We have the Klaviyo SDK running.

At the moment the customer places an order and reaches the “Thank You” page, how do we add a custom variable into the payload sent to Klaviyo so that it gets into the customer’s Klaviyo profile?

More specifically, we are trying to push into Klaviyo a specific cookie value we set in the customer’s browser.  It’s easy enough to get the cookie value (whether in JavaScript or PHP).  But how do we hook into the payload that Klaviyo sends with the ‘order complete’ event and add our custom value / property?

 

We weren’t able to find an answer in Klaviyo’s documentation.

Best answer by Brian Turcotte

Hi @ScottCodes and welcome to the Community!

 

Just to clarify, do you already have a Placed Order metric firing, and you want to create an entirely new metric? Or are you hoping to pack in an additional profile property into the Placed Order metric that already exists?

 

Here’s our Developer Documentation on the recommended structure of a custom Placed Order metric:

 

Under the “profile” tag, you can see that there are profile properties listed such as "$first_name": "John", "$last_name": "Smith". You can add additional profile properties here that will be passed into the profile upon the order firing. This method may take some personalized development help, so if you’re interested, you can always reach out to one of our official Klaviyo Partners here.

 

If you wanted to accomplish the basis of this use case without extensive development, you could also use a Klaviyo flow in tandem with the native Placed Order product. First, you would navigate to Flows > Create Flow > Create From Scratch, and then once you’re in the editor, you could choose the Placed Order metric as the trigger:

 

Then, you can just drag in an Update Profile Property block, and add Create a New Property. Now, whenever someone places an order, they will be directed through this flow and a new property will be added to their profile.

 

If I misunderstood your use case, please don’t hesitate to let me know, but I hope this helps!

- Brian

View original
Did this topic or the replies in the thread help you find an answer to your question?

1 reply

Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • February 10, 2023

Hi @ScottCodes and welcome to the Community!

 

Just to clarify, do you already have a Placed Order metric firing, and you want to create an entirely new metric? Or are you hoping to pack in an additional profile property into the Placed Order metric that already exists?

 

Here’s our Developer Documentation on the recommended structure of a custom Placed Order metric:

 

Under the “profile” tag, you can see that there are profile properties listed such as "$first_name": "John", "$last_name": "Smith". You can add additional profile properties here that will be passed into the profile upon the order firing. This method may take some personalized development help, so if you’re interested, you can always reach out to one of our official Klaviyo Partners here.

 

If you wanted to accomplish the basis of this use case without extensive development, you could also use a Klaviyo flow in tandem with the native Placed Order product. First, you would navigate to Flows > Create Flow > Create From Scratch, and then once you’re in the editor, you could choose the Placed Order metric as the trigger:

 

Then, you can just drag in an Update Profile Property block, and add Create a New Property. Now, whenever someone places an order, they will be directed through this flow and a new property will be added to their profile.

 

If I misunderstood your use case, please don’t hesitate to let me know, but I hope this helps!

- Brian