Solved

How to update consent using API?

  • 8 July 2021
  • 7 replies
  • 2328 views

Badge +2

Hi!

I’m using the Identify API to update customer information including $consent. But I want to update the consent or sometimes remove it.

Updating $consent: [“”] or $consent: null doesn’t change the Consent Status on my customer profile.

Also sending $consent: [“sms”] shows as consent status subscribed on my email channel section instead of sms channel section. It doesn’t matter what value I send to the $consent array it always subscribes to email. Is this right?

Thanks,

Guillermo

icon

Best answer by Dov 9 July 2021, 16:43

View original

7 replies

Userlevel 7
Badge +36

Hi @more2science!

 

One way to remove consent from profiles is to use the V3 Unsubscribe Profiles. If you wanted to remove them from an individual list as well, you just have to pass in the list_id of that list. 

 

I hope this helps!

- Brian

Badge +2

I have a similar issue. I can send an event using client side javascript like:

 

klaviyo.push(['identify', { $email: ‘email@email.com’, $consent: 'true' }]);

 

When I do this a profile gets created in klaviyo and its gets the green tick consent status section.

 

However I need to be able to remove consent if the visitor wants to.

 

This doesn't work: klaviyo.push(['identify', { $email: ‘email@email.com’, $consent: 'false' }]); 

 

I’ve also tried: klaviyo.push(['identify', { $email: 'info+klaviyotest3@onlineretailguy.com.au', $consent: '' }]);

 

Can you point me in the right direction.

 

 

Userlevel 7
Badge +61

Hi @nandorhargita,

Thanks for your follow-up reply.

And for anyone else following along specifically with respect to UK and Australian numbers, my colleague David spoke to resolve this in the thread below:

The key idea being “If you plan to send in the UK or Australia, edit your alphanumeric sender ID to indicate your brand. Setting this up is key, as you will not be able to collect SMS consent from people in these countries until you have an active alphanumeric sender ID.”

Thanks for being a member of our community.

Badge +2

Hi @Dov and @David To Thank you for the detailed explanation. My problem is that consent is not being applied to Australian numbers, collected on single opt-in lists. Numbers stay in the “Contact” on Profiles UI, and the “Consented to receive SMS” event is not triggered for them.

While US numbers get the consent with the same (non-Klaviyo) popup.

$consent[sms] and sms_consent:true is sent every time. Sadly no topic - dealing with sms consent on API - solves my issue. At least not yet :)

Userlevel 7
Badge +60

Hello @Guillermo Tama,

Building on top of the great points @dov.derin has already made, there wouldn’t be any further required configurations for the consent values so long as you are making the correct calls utilizing Klaviyo’s List V2 endpoint. To learn more about Consent is stored within Klaviyo, I would recommend reviewing the How Consent is Stored in Klaviyo subsection in the Guide to Collecting GDPR Compliant Consent article. 

Furthermore, you depending on what it is you were trying to accomplish, you can either unsubscribe users from a specific list through once again, leveraging Klaviyo’s List V2 endpoint as detailed in the Unsubscribe Profiles From List subsection of the  Klaviyo API Documentation. Alternatively, if you wish to suppress a contact and you can leverage Klaviyo’s List V1 endpoint as highlighted in the Exclude Profile From All Email section of the same API Document. 

I hope this helps!

David

Badge +2

Thanks for your response @dov.derin! That was very helpful.

What about other $consent values? web, directmail, mobile and email? Is there any required configuration for this? I need to cover all scenarios.

Also, Can I unsubscribe to consent status with Identify API? For example: I subcribe with $consent: [‘email’] and we need to unsubscribe that consent status. I tried sending email_consent: false but it doesn’t work I guess this fields works only with the List API.

 

Thanks,

Guillermo

Userlevel 7
Badge +61

Hello @Guillermo Tama,

Thank you for sharing your question with the Klaviyo Community.

First, I recommend ensuring that you have met all of the SMS setup requirements before you attempt to update the subscription status via the API. I also recommend double-checking that your API request for $consent matches the formatting used in our sample code. Also, since collecting SMS consent utilizes the List V2 API’s Subscribe endpoint, by default, a confirmation message will be sent out, only after consent is confirmed via SMS, will the SMS portion under the Channels section of the profile update. If the value under $consent is [“sms”] this will apply to the SMS consent portion of the profile, rather than the email consent status.

Reply