Bucket.io is a really cool service for creating surveys and quizzes that let you segment users for precision follow-up. It uses zapier to integrate with email services which is great… unless your ESP doesn’t have a zapier integration which is the case with Klaviyo.
Here’s the workaround to connect Klaviyo and Bucket.io:
What you’ll need:
- Klaviyo API key
- Klaviyo LIST ID
Klaviyo API Key
In your account drop down click Account > Settings > API Keys and create a new key and name it Zapier. Copy this to a text file for usage in a later step.
Klaviyo LIST ID
Create the new LIST if you don’t already have one. Otherwise click the list and copy the URL to a text file. It will look something like this:
The part you are looking for is Qxjh6s. Save this to the text file too.
Setup The Zap
- Create a new ZAP with the trigger of BUCKET.IO. You might have to setup this app first by clicking the integrations section inside Bucket as it might not be publicly visible in the available apps otherwise.
- Choose the options for your survey and move on to the ACTION step of the ZAP setup
- For the ACTION choose WEBHOOK and select POST.
- For the URL you will use this as your template:
Replace LISTID with the actual list ID from your Klaviyo list. In this example Qxjh6s is what my ID is. Copy the API KEY from your text file to replace KEY. It will look something like pk_1234567890abcdefghijkl
- Your new URL will look something like https://a.klaviyo.com/api/v1/list/Qxjh6s /members?api_key=pk_1234567890abcdefghijkl which gets pasted to the URL step of Zapier.
- There are a few other options that you will need to update:
Payload Type = form
Wrap = No
Unflatten = No
email Search for the Email Code From Bucket via Drop Down
It’s important to use the confirm_optin=false or else it will require them to confirm their opt-in.
Create a test and you should get a success message. Check your list and the user should be in there. It is a good idea to do this if you are going to use the advanced section below.
Advanced – Adding Custom Fields
Inside bucket.io you can create custom fields that get passed to the record. In order to do this we will setup another step after the first webhook to update the user record. We’ll pass these custom fields in the URL. Remember: the querystring (the part after the ? in the URL) uses the & symbol to connect pieces together.
- Click the big + to add another step to the end
- Choose WEBHOOK again but this type select PUT as the type
- The URL this time looks like this:https://a.klaviyo.com/api/v1/person/PERSON_ID?api_key=KEY&first_name=NAME&field1=FIELD1
- The PERSON_ID is created by a dropdown selection from the first WEBHOOK. When it is successfully created it will pass information back to Zapier that you will need.Highlight the PERSON_ID in the URL and then choose the dropdown and look for the Person ID. Select it and it will enter the code.
- Next paste your API KEY in the section again. This is the same key used for the first webhook.
- In the first name section you’ll again use the dropdown to put replace NAME with the code for the first name of the user.
- For the field1 part we will change this to be the first custom field that we want to add to the user’s record. Let’s say we’re tracking the sex of the user (male or female).So you would change:&field1=FIELD1to&sex= and then enter select the custom field code from the dropdown in the bucket.io step.
- Payload type this time is JSON
- Wrap and Unflatten are both NO
- Hit continue and give it a test.
What’s actually happening:
Bucket.io will pass the data to zapier when a user submits a survey response. In the first step we create the user account in Klaviyo (POST) and then get some data back, like the user’s ID (Person ID). We then make another call to Klaviyo to PUT some data in their record which is the custom fields.
These custom fields can then be used to trigger specific messages in Klaviyo Flows. For example, when the user submits a survey and they are FEMALE send a specific email. If they are MALE then send one for the guys. One thing to remember here is that you should make that email wait 0.10 hours from when they are added to the list just in case the custom fields don’t get added quick enough.