Solved

Unable to Fetch Phone Number from Order Placement

  • 14 September 2021
  • 10 replies
  • 163 views

Badge +2

Hi - So we are unable to fetch the Phone number from the billing data i.e passed from placed order to Klaviyo. 
We are sending data according to the API integration document provided from Klaviyo support. 
Below are the screenshots where we are not able to fetch the phone number from the billing data. 
Also the curl and logs screenshots attached for better visibilty. 

 

icon

Best answer by Dov 20 September 2021, 16:24

View original

10 replies

Userlevel 7
Badge +61

Hello @Jawad Khan,

Thank you for sharing this with the Klaviyo community.

I had to removed 3 of the screenshots because they exposed an email address, other personal information and an API key. Can you please re-upload those screenshots without any personal information or API key included please?

Badge +2

The updated screenshots for the above description are posted below

 

 

Userlevel 7
Badge +61

Hi @Jawad Khan,

Thank you for sharing this.

I can see phone number is turning up in the event data within your template. When you click on the word “phone” in the preview, it will produce a dynamic tag. Adding that tag to your email should allow you to display the phone number.

This process is described in more detail in the thread below:

https://community.klaviyo.com/email-templates-and-coupons-32/product-prices-not-showing-up-in-dynamic-abandoned-cart-emails-1326

Alternatively, you can try inserting the default Klaviyo tag for phone number which is:

{{ person.phone_number }}

and can be found here.

I hope that is helpful.

Badge +2

Hi, 

Thank you for the response. I can see the phone number and can pull that into the email using the dynamic tag. 

The question was, Can I use that phone number (dynamic tag) to update customer profile and add the phone number next to his / her profile?

Userlevel 7
Badge +61

Hello @Jawad Khan,

Thank you for the follow-up reply.

Yes, you can use Klaviyo’s List V2 API’s Subscribe endpoint to add a phone number and its corresponding consent data to profile. You can find an example here.

The script will make a POST request to the Subscribe endpoint: https://a.klaviyo.com/api/v2/list/{LIST_ID}/subscribe and include a small JSON payload.

You can only add the phone number to the profile and market to those users via SMS using one of the methods outlined here. This includes:

  • Klaviyo signup forms, which you can use to target new and email-only subscribers
  • Consent at checkout (for certain integrations only)
  • Click-to-text forms
  • List API
  • Email banners

 

I hope that is helpful.

Badge +2

Hi Don, 

Thank you again for your reply. The question is not around consent for sending communication via sms. We just want to be able to add the phone number to the customer profile. Since the phone number is visible in the order information. Can we use that info to add phone number to customer profile and if yes, how?

Thank you!

Userlevel 7
Badge +61

Hi @Jawad Khan,

Thanks for the clarification.

There is not a way to “translate” the phone number from the event data for phone number currently being used in the order confirmation email directly into the customer profile.

In order to add phone number to the customer profile, you would have to make a separate API call, for example to the subscribe endpoint: https://a.klaviyo.com/api/v2/list/list_id/subscribe and include the phone number in the payload. For example, in our documentation here.

 

I hope that helps clarify your question!

 

Badge +2

Hi Don, 

Thanks for sending the solution. We have implemented on our side and it did not work. Is there a way to expedite this. This is urgent requirement from the client and all solutions provided have not helped so far. 

I am sharing the details of implementation on our side. Please let us know if we missed something or if  there is a separate API call for this specific requirement. 

Here is the epsagon log of confirmation for when the phone number is sent after order confirmation
 

 

Here is the profile for which data was sent and it does not show the phone number updated. 

 

 

Can you please help as this is really urgent?
Thanks.

Badge +2

Hi Don,
Any update on this?
 

Userlevel 7
Badge +61

Hi @Jawad Khan,

Thanks for the follow-up reply.

You can send phone number using properties on an Identify request or customer_properties on a Track request. This documentation shows some reserved property names you can map with the API.

Second, please make sure that the phone numbers submitted are in an acceptable format: Accepted Phone Number Formats for SMS in Klaviyo.

If you are still having trouble after taking these steps, I recommend sending the payload to the support team and they can troubleshoot further.

Thanks for being a member of the community. 

Reply