Hello! I am looking to send a campaign to a certain segment of customers. This campaign needs to have a unique key (text string) sent to each customer.
Ideally, Klaviyo’s campaign automation would—for each email—hit our dedicated API endpoint to generate the unique key, then leverage the API response to integrate the key into the template. Is this possible?
In my research so far, it seems that the above approach is not an option. So the next best option would be to first assign keys to those customers’ profiles (as custom profile properties) whenever they join the aforementioned segment. It seems that the best way to do that, is by using Klaviyo’s Code feature. I think I can achieve this by using event:klaviyo.subscribed_to_list as the function trigger, filtering only events that fired from the target segment.
This is where my problem lies. Assuming the first approach is impossible, I am now faced with the problem of Klaviyo Code seemingly not having any comprehensive documentation. Am I missing something? All that I’ve been able to find is the “Getting started with Code” help article, where the example code doesn’t really lend to my use case. Problems:
- I am using Node.js and can’t find any details or docs on how to use the klaviyo-api module for Code
- Code itself does not seem to have any thorough docs
If there’s a better way to do what I’m trying to do, please tell me. Or at least guide me to where these elusive docs are. Thanks!
- Reavo