Darren Crawford

Darren is a guy who loves marketing technology.

Connect Bucket.io to Klaviyo

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:

https://www.klaviyo.com/list/Qxjh6s/survey-list

The part you are looking for is Qxjh6s.  Save this to the text file too.

Setup The Zap

  1. 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.
  2. Choose the options for your survey and move on to the ACTION step of the ZAP setup
  3. For the ACTION choose WEBHOOK and select POST.
  4. For the URL you will use this as your template:
    https://a.klaviyo.com/api/v1/list/LISTID/members?api_key=KEY
    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
  5. 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.
  6. There are a few other options that you will need to update:
    Payload Type = form
    Wrap = No
    Unflatten = No
    Data:
    email                        Search for the Email Code From Bucket via Drop Down
    confirm_optin       false

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.

  1. Click the big + to add another step to the end
  2. Choose WEBHOOK again but this type select PUT as the type
  3. The URL this time looks like this:https://a.klaviyo.com/api/v1/person/PERSON_ID?api_key=KEY&first_name=NAME&field1=FIELD1
  4. 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.
  5. Next paste your API KEY in the section again.  This is the same key used for the first webhook.
  6. 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.
  7. 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.
  8. Payload type this time is JSON
  9. Wrap and Unflatten are both NO
  10. 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.

Posted in , ,

5 Comments

  1. Lindsey on July 20, 2017 at 7:51 pm

    Hello! I tried doing this, followed your steps exactly and got the following error message: a.klaviyo.com returned (400) Bad Request and said “This request is missing the following required params: “email”.”

    Any idea on how to get it to work?

  2. Chris M. on July 30, 2017 at 1:19 am

    Wow! This was super helpful for me in another context.

    I have a question though…

    What’s the reason you can’t include “first_name” in the first POST webhook?

    Is there no way to send all data with just 2 steps in Zapier?

    Thanks for your help!

Leave a Comment