Solved

Sync profile properties with external system

  • 5 April 2023
  • 7 replies
  • 298 views

Badge +1

I’m the CTO of a software that allow customers to download loyalty cards (via apple and google native wallet application) and I try to create a custom integration with klaviyo. 

One of the scenario is to send an email to customers that don’t have their loyalty card installed. This email will contains a customized secured link to let them download their loyalty card. The link is unique for each customer, it contains a JWT token to guarantee that only the recipient of the email can download the loyalty card.

From what I understand, there is no way to compute JWT token (nor hmac) while we send an email. The only solution I found is to add a custom property for each profile. 

 

How can I sync this custom property with an external system ?

 

The only solution I found is the following : 

  1. Create a segment with profile without the custom property 
    1. For new profiles :
      1. Create a flow that is triggered from this segment 
        1. Send a webhook to our API
        2. call the Klaviyo update profile API ( https://developers.klaviyo.com/en/reference/update_profile )
    2. For initial setup
      1. From our application : download all profiles from the segment
        1. use Klaviyo segment API  https://developers.klaviyo.com/en/reference/get_segment_profiles
        2. I acknowledge that this API is limited to 150 call/ minutes with 100 profiles per call (15 000 profiles / minutes). We have existing customer that already have 500k customers on their database. It results in +30 min operation and the implementation is not straightforward
        3. Generate a CSV with custom property from this list 
        4. MANUALLY upload the CSV to klaviyo 

Is there any other solution ? 

This solution require each of our customer to do plenty of operation with klaviyo 

  1. Configure a new segment
  2. Configure a new flow 
  3. Configure the webhook (which require 2FA) 
  4. Manually upload a CSV for initial import 

Are they any API to automate these tasks ? 

 

It looks like other software editor already sync data https://help.klaviyo.com/hc/en-us/articles/115005253208-How-often-integrations-sync-reference but I can’t find how to make the same things. Is there any documentation on how to create a similar integration ? 

icon

Best answer by Omar 18 April 2023, 11:08

View original

7 replies

Userlevel 7
Badge +36

Hi @cdurand!

 

I’m going to check with Engineering to see if there are any known workarounds and I’ll update the thread shortly when I know more.

 

Thanks,

Brian

Userlevel 7
Badge +36

Hi @cdurand!

 

Although it will depend on the structure of your system, if the basic premise of this use case is to extract profile information out of klaviyo so you can put it into a new database, you can do that by calling either of these two endpoints:

 

The first endpoint fetches a single profile, and the second fetches multiple profiles, so it’s possible you could use these endpoints to automate the export of profile properties. If you are interested in extra development help, you’re always welcome to reach out to one of our wonderful Official Klaviyo Partners.

 

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

- Brian

 

Badge +1

Hi Brian, 

My basic need is to send a personalized email to a profile. Each profile have its owned link. How can I make this ? 

The only way I found is to add a custom property to a profile. I understand how I can add custom property via API, it works great for new profile but how can I make it work for an existing database with plenty of profiles ? My customers already have database with +100k profiles. 

I recently discover the back-populate flow option. It can help sending a call to my API and then I can update the profiles but once again I may hit the API limitation

 

How the GetProfile and GetProfiles Api could help ? These are also limited to 700call/minutes and 150call/minutes. 

 

Is there any API I can use to send a CSV ? Is there any API I can use to create and configure the flow ? 

By the way, we are on the way to become a Klaviyo partner

Thanks,

Userlevel 2
Badge +5

If you’re handling this with a custom profile property, you can probably use the SFTP upload to update existing profiles:
https://developers.klaviyo.com/en/docs/use_klaviyos_sftp_import_tool

 

Userlevel 7
Badge +60

@stem, was just gonna mention the same thing! Really appreciate you highlighting that in another Community post recently as well:

@cdurand, although there isn’t a way to build a flow via API, there are some limited actions you can take through our Flows endpoint such as updating the status of a flow, getting the flow message ID, etc. 

David

Badge +1

Thanks @David To and @stem, I was not aware of the SFTP feature I will have a look and try this. Unfortunately from what I understand it will add more complexity for our client to do the integration. 

 

To integrate with Klaviyo our customer needs to : 

  • create an API endpoint 
  • Configure 2FA 
  • Configure a flow with custom webhook to our API
  • Configure SSH keys in klaviyo 

Looks very difficult and I would love to have a “one click” solution.

 

We offer digital loyalty card to customer through native mobile wallet (apple & Google). My need is to send a personalized link for each profile to download their loyalty card. The personalized link can be computed with hmac_sha1 or any JWT token or I can adapt to include anything else that guarantee security. 

The setup for such a simple operation looks very difficult and our customers may not successfully do it. Can we automate things ? 

Otherwise I will document this process and hope our customer doesn’t make any mistake while configuring all the process. 

Userlevel 7
Badge +44

@David To @cdurand I logged in back to the community because of an update email I just got from Klaviyo as well about this very specific SFTP solution.

Building out the integration that also back populates would be the best option here. It will take time to sync depending on the amount of data to transfer but is the easiest solution for end customers. Similar to how most current plugins also work. Most loyalty programs work like this already.

SFTP would be an option for a single import but requires work from the people using your platform.

  1. Sync profiles from your side to Klaviyo (use API) - (near) realtime and initiate an historical sync
    • Either through create or update profile API
    • add the personalised link or the variable used to create that link if you don't want to send the whole url.
      • Either the whole url: www.site.com/personallink/withvariable
      • or, only {{ withvariable }} as a custom profile property so you can reconstruct it with adding the first part of the URL yourself.
  2. Send an event that someone registered for loyalty using create event API

I don't think there is a need to push the webhook to your system. Either people have the custom property or they don't. The data should be always pushed to Klaviyo.

Having the event in place will help with filtering out people from a flow if they do become a member.

I'm assuming that you're a SaaS tech vendor that facilitates these loyalty cards for your customers and want to make it easy for end customers to set this up in Klaviyo.

I would suggest to install some of the current solutions and just have a look at how they work.

i.e. check LoyaltyLion 
https://help.loyaltylion.com/en/articles/3128638-klaviyo-email-integration-manual
https://help.loyaltylion.com/en/articles/5511385-klaviyo-events

 

 

Omar Lovert // Polaris Growth // Klaviyo Master Platinum Partner

We help with e-commerce growth through CRO, Klaviyo and CVO

 

 

 

 

Reply