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.
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!
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!