Hello Developer Group!
Our May 2023 πΒ Developer ChallengeΒ πΒ is here!!!
Β
Each month, I work with one of our internal Engineers or Solution ArchitectsΒ to generate a challenge that requires contestants to accomplish a technical feat using Klaviyoβs developer tools.
Β
ππ°Β New CASH Prize!!!Β π°π
Β
Due to the successΒ of previous challenges, weβve decided to sweeten the rewards for May!
Β
Now, the winners and runners-up will receive the following prizes:
- 1st Place:
- $500 Cash Prize
- π¦π Customized Social Media Package for LinkedIn!Β ππ¦
Special Winnerβs PinΒ in Community!Β π
π βKing-of-the-hillβ π style article. Winnerβs profile will be featuredΒ on the Developer Group landing page until they are unthroned!
Β
- 2nd Place: InsulatedΒ Branded MugΒ β
Β - 3rd Place: Klaviyo-branded CapΒ π€
Β

2nd (right) and 3rd Place (left) Prizes Β
Β
ATTENTION
Contest is open to legal residents of the contiguous United States, Canada (with the exception of Quebec), Australia, and the United Kingdom
Β
Β
πΒ Rules and GuidelinesΒ π
- The Challenge will be open untilΒ Monday, June 12Β at 11:59 pm ESTβ³, after which the submission form will be closed.
Β - You may use any resourceΒ at your disposal to investigate the challengeΒ -Β including, but not limited to theΒ Developer Portal, existingΒ CommunityΒ posts, andΒ theΒ Klaviyo Help Center.
- Please noteΒ that there can only beΒ 1 WINNERΒ (theΒ firstΒ to submit a valid solution), so collaborate at your own riskβ¦π
Β
- Please noteΒ that there can only beΒ 1 WINNERΒ (theΒ firstΒ to submit a valid solution), so collaborate at your own riskβ¦π
- CommentsΒ areΒ enabled forΒ this post (for questions and clarification), but please only use the Google form below to submit answers.
- If you comment the answer here, it will spoil the fun!Β π
Β
- If you comment the answer here, it will spoil the fun!Β π
May 2023Β Challenge
Β
This month's challenge will focus on our new Predictive Analytics API, which can be used in association with any operation that retrieves a profile or profiles. Predictive analytics brings you a rich suite of data-science based statistics, including data on Customer Lifetime Value (CLV), churn probability and expected date of next order.
ΒYou are tasked with the following:
-
Given a profile ID, find the predicted CLV of the profile
-
Given a segment ID, find the average predicted CLV of the segment
-
Rank all segments in your account by average predicted CLV
IMPORTANT: Not all profiles will have CLV metrics based on the data available in your Klaviyo account; for the purposes of this challenge, feel free to mock API responses if your account is not yet able to receive CLV metrics. That said, your solution should still work even if a profile has null values for its predictive_analytics data.
ΒWe are excited to offer you an in-browser development environment through Napkin.io! Klaviyo acquired Napkin in November and we are using it internally for a variety of key functions and hope you will do the same. For this challenge, please submit your answers as a Napkin function by following the steps below:
Β-
Create an account in Napkin - you can sign up via Google, GitHub, or email
-
Clone one of the following Napkin function:
-
The cloned function will give you some boilerplate code that allows you to make API calls with our SDKs. Once you have cloned the function, you must get a private API in your Klaviyo account and add it to your Napkin environment
-
Once you have your private API key, set it as your KLAVIYO_PRIVATE_API_KEY under βOtherβ in your Napkin function like below:

-
Once you have your solution, share your Napkin function. You can get a URL to your public function by clicking Share like in the screenshot below:

Β
-
Finally, submit the URL with your name and other details using the form below!ββββββ
Β
ATTENTION
Contest is open to legal residents of the contiguous United States, Canada (with the exception of Quebec), Australia, and the United Kingdom
Β
Β
SUBMIT YOUR ANSWER HERE:
Β
- Brian