Sync consent status between platforms
Nani, a natural skincare brand, collects consent from a few different platforms. In order to maintain a single record of consent, they manage an external database that aggregates all of the consent data. In order to ensure this database is updated with opt ins and opt outs from Klaviyo, Nani needs to sync consent status from Klaviyo to this database on a regular basis.
Check out this video to see why and how Nani was able to set up this integration.
Use the end goal to structure data
Click through the dropdowns below to see how Nani used the 4-step framework to map their data and sync consent to their external database.
Identify the end goal and requirements
Consent is dynamically updated in Klaviyo based on customer actions, such as opting into SMS or unsubscribing from email.
Nani's end goal is to sync consent status from Klaviyo into their custom external database.
On Klaviyo's end, the required data is:
- Consent status for all profiles
They will also need a way to store and ingest data in their external system.
What data do you have access to?
All of the required consent data is in Klaviyo. Nani has access to all of the data in their Klaviyo account, so they do not need to make any changes in order to access all required data.
How should the data be structured?
In order to retrieve consent data, Nani first needs to understand how consent is stored in Klaviyo.
Consent by channel
Klaviyo maintains consent independently for three communication channels: email, SMS, and push notifications. Nani wants to sync over data about all three of these communication channels to their external platform.
Consent on the profile level
Next, Nani dives into what consent looks like in Klaviyo. Consent is stored on the profile level in Klaviyo, so each profile will have email, SMS, and push consent statuses associated with it. A profile can have a different consent status for each channel.
There are three possible consent statuses:
- Subscribed
- Unsubscribed
- Never subscribed
Subscribed means customers have explicitly opted in to that channel's marketing. Unsubscribed means that customers have explicitly opted out of that channel's marketing.
Finally, Never Subscribed means that customers have neither opted in nor out out of marketing. Customers who have Never Subscribed to SMS or Push notifications are unable to receive marketing from these channels, since these channels require explicit consent. Customers who have Never Subscribed to email are still able to receive email, but general best practice is to only send email marketing to customers who have explicitly opted in, i.e. have a Subscribed status.
You can read more about omnichannel consent statuses in our guide to understanding consent in profiles.
Suppressed profiles
Finally, Nani learns about suppressed profiles. Suppressed profiles cannot receive email marketing. Profiles can either be suppressed automatically, such as if they have an undeliverable email address, or manually by uploading a list of suppressed profiles.
With this background knowledge in place, Nani decides they want to sync:
- Each profile's consent status for each channel
- Each profile's suppression status
Since consent and suppression status are stored on the profile level, this means that Nani will want to pull profile data out of Klaviyo. They will need to ensure this data includes the following information:
- Consent status for each channel
- Suppression status
Identify the correct endpoint(s)
Nani is looking for profile-level consent. Therefore, they choose to use the Get Profiles endpoint, which returns data about all profiles in their Klaviyo account.
Looking through this endpoint's documentation, they also see that subscription information is not included by default, but they can get this information as well using the query parameter additional-fields[profile]=subscriptions:
Nani has thousands of profiles in their account, so not all profiles will show up at once. Rather, Klaviyo's APIs support cursor-based pagination, so Nani can work through all of the pages of returned profile data.