Solved

Registering SMS Only contacts with the track API

  • 16 February 2022
  • 8 replies
  • 160 views

Badge +2

I am looking to trigger an event when a customer adds their phone number to an integrated contact form on my website.

Here is the data object:

 

{

  token: "XXXXX",

  event: "Registered For Reminder",

  customer_properties: {

    $first_name: "NAME",

    $last_name: "LAST",

    $phone_number: "1234567890",

    $consent: ["sms", "email"],

    sms_consent: true,

  },

  properties: { auction_name: "Test Auction" },

}


The API returns “1” and yet I am not seeing it in the dashboard. I made the same API call but removed consent and phone number while adding email and it worked perfectly fine. It is a bit ridiculous that there isn’t any documentation anywhere on why this isn’t working an no response from the API other than to say that the request is valid.

Help would be appreciated as I’ve tried everything I can think of to get this working.
 

icon

Best answer by cdetdi 18 March 2022, 02:32

View original

8 replies

Userlevel 7
Badge +60

Hi @byroncodes

 

Thanks for sharing your question with us! Happy to share some insight into what could be happening here! 

 

First, the reason why the API call worked successfully when you removed the consent and phone number is because that call is not compatible with those profiles. You will need to use our List APi, not track, in order to collect SMS consent. If you want to include email in this call, I would add the email per this help center documentation

 

Additionally, it should be noted that the  $consent field will not update SMS consent. It is more of a  “regular”  custom property, not relating to subscribing users to email or SMS. the only different between $consent and other custom properties is that it only ingests specific values! 

 

To gain further insight, I’d take a look 

 

Badge +2

@Taylor Tarpley Thanks for the response. Even if I remove any content in regards to consent from the API call, the user still does not appear in the dashboard at all. Is there a reason for this? The track API explicitly says that it is possible to pass a phone number instead of an email so I am confused as to why this isn’t working, even if the user does not have consent to send SMS.

Userlevel 7
Badge +60

Hi @byroncodes

 

Thanks for that additional info! So we can get to the bottom of this, do you mind sharing what your end goal is? Additionally, do you mind sharing your successful, with only email, and unsuccessful payload? 

 

Finally, do you mind sharing if you’re making this call via Python or Postman? Did you call utilize a valid phone number? 

 

Looking forward to working this out together! 

-Taylor 

Badge +1

Any luck with this? I’m running in to the same issue with the `identify` endpoint. If I only pass a phone number and not an email I get a successful response but I’m not seeing any profiles in Klaviyo with that phone number. What am I missing?

Userlevel 2
Badge +6

I want to reemphasize the concept that $consent does NOT result in a SMS subscription.  I ran into the same frustrations until I realized this.  SMS consent is triggered via LIST subscription, not profile data.  I now make two calls when SMS is subscribed too: profile and list. 
 

As for no profiles appearing I think you need one “anchor” property: either email or unique ID.  Your data packet doesn’t have either. Try submitting the phone number with an $id and see if Klaviyo will accept it.

Badge +1

Thanks @cdetdi , passing an id along worked. Have to have a look how this would affect previously created profiles since we’ve always let Klaviyo handle creating the ids since we previously always passed an email along. I believe ids take precedence over email so would have to handle merging the data without losing the previously created profiles somehow.

Badge +1

Actually, looks like manually assigning an id creates an external ID prop so should probably be fine in terms of not conflicting with existing profiles

 

Userlevel 2
Badge +6

Maybe.

If you specify $id in your call it will show the field but if you don’t specify the $id it will not show it even though it got auto assigned.  The behavior isn’t consistent.  You also may find yourself running into the duplicate profile issue.

Reply