Hello Lukas (@eevees.com),
Great question!
You should be able to leverage Klaviyo’s Track and Identify API to create this custom “pre-order” event, similar to Klaviyo’s Add to Cart event. This is because Klaviyo’s Add to Cart event is in fact a custom track API call that is being made when a user clicks on the add to cart button on your product page after they have already been identified through being cookied.
To build and create your own event that would act similar to Klaviyo’s add to cart functionality, I would recommend reviewing the following resources to learn more about Klaviyo’s track and identify API and how to build your own events to be synced to Klaviyo:
Since this function would be custom work, for further assistance in creating and building these APIs, I would recommend reaching out and working with a developer you are familiar with or finding a Klaviyo partner from our extensive network of partners.
I hope this helps!
David
Damn ok so almost verbatim same answer as I got from CS via email… that’s fair! I suppose I have to put on the big boy pants or pay up :P
@eevees.com I think to be fair to Klaviyo, anything “custom” can vary greatly so they can only point you the resources so you or your developer can tackle it accordingly. Not to mention, these requests for things like “Just Copy X but Change One Thing” never ends up as straightforward as you think.
BUT… I’m going to take a stab at this for ya.
You just need to change a few things:
- Your Pre-Order button needs to have different Class or ID name than your Add to Cart button. Use that instead of “Pre-Order” ID in my example below. And this example is using it by an ID.
- Change the Metric name from “Add to Cart” to something like “Added to Pre-Order”
- This code also depends on the “View Product” event.
So your code will look like this:
<script type="text/javascript">
var _learnq = _learnq || t];
document.getElementById("Pre-Order").addEventListener('click',function (){
_learnq.push(c'track', 'Added to Pre-Order', item]);
});
</script>
If everything lines up correctly, that should mimic your custom “Add to Cart” button and send in a different (and separate) event called “Added to Pre-Order” for you to use for Flows or Segmentation.
Wow @retention AKA Joseph, I didn’t see this response until now… thank you so much for writing this up!
Just for clarification, I would:
- add this script to my product.liquid section, right under where I added the custom add to cart ID snippet?
- wait, im actually kind of stumped on this part… if I change the ‘added to cart’ metric on klaviyo, then I don’t have the ability to track that anymore, no? I’d like to have both of them. Or am I misconstruing what you’re saying?
- If I do indeed paste that code into the product.liquid, would I then just do the same thing I did with the add to cart metric, as in, just trigger the event on my site and then it will appear? Could it be so simple? It was indeed that simple with the add to cart metric, so I guess maybe it could be!
Thanks again!