Solved

Survey Sparrow x Klaviyo integration via Klaviyo API


Badge +1

I am trying to send over survey submission data from Survey Sparrow to Klaviyo and I’m having some issues.

My requirements:
1. I want to subscribe users to both Email and SMS
2. I want to send all quiz answers to Klaviyo Custom Properties so in flows I can show different content based on these properties
3. I want to add these leads to a list or segment

 

I have been doing this with the Add/Subscribe Profiles to a List request through Make.com but the API event got deprecated. 

 

Also - when doing it this way I was unable to subscribe to SMS, I was just subscribing to email. 

 

I have been playing around with the new API revision 2023-02-22, but am having some issues.

I am using the following POST calls.

https://developers.klaviyo.com/en/reference/subscribe_profiles

As well as:

https://developers.klaviyo.com/en/reference/create_event

 

Now on to my current limitations and struggles. 

 

For some reason even though I have subscriptions to both email and sms, the sms consent doesn’t come through in Klaviyo when dynamically filling the email and phone number with Survey Sparrow Variables inside the webhook. 

 

When I test with the prefilled data of: 

          "email": "matt-kemp@klaviyo-demo.com",
          "phone_number": "+15005550006",

It works, both SMS and email consent come through, but as soon as I change to the dynamic variables only email consent comes through. 

 

It may have something to do with the survey sparrow phone field having a space after the country code, but the number comes into klaviyo fine - just missing SMS consent. 

 

Also when doing this POST
https://a.klaviyo.com/api/profile-subscription-bulk-create-jobs/ I don’t see how to pass back custom properties to the contact.

 

As a work around I tried using the create event API post call.

But, when using the create event API call, it pushes the survey data back to the event properties, not the contact properties. 

 

This won’t work as I can only dynamically show content in emails based on custom contact properties not event properties. 

I guess I could do trigger splits, but that won’t allow me to use survey data in campaigns - it will limit it to event based flows. 

 

Any help with this would be greatly appreciated. 

icon

Best answer by Brian Turcotte 26 May 2023, 21:28

View original

2 replies

Userlevel 7
Badge +36

Hi @connectedconnor!

 

I’m going to check with Engineering about the best way to approach this one, and I will update the thread as soon as possible.

 

Best,

Brian

Userlevel 7
Badge +36

Hi @connectedconnor!


My apologies for the delay here!
 

The reason you’re only seeing email consent is because SMS consent requires that the phone number is formatted correctly. In other words, if there is a space between the country code and phone number, the number will not be passed and consent will not be marked. I tested this myself, and when the number is formatted correctly (+[country code][phone number], no spaces), SMS consent is collected.

 

Here are some other requirements to consider when passing a phone number into Klaviyo via API:

  1. The number is a valid (real) phone number.
  2. Your account’s sending number supports the country code.
  3. You have no spaces between numbers.

 

Regarding your other point (wanting to pass quiz answers as custom profile properties), you can do that using the Update Profile API endpoint, which is a PATCH request that allows you to pass custom properties:
 


I hope this helps to clarify, and thanks for using the Community!

- Brian

Reply