Setup Guide
1
Authenticate with APIs
Get your Klaviyo API key and Factr API key.
2
Build profile enrichment job
Create a scheduled service that enriches Klaviyo profiles via Factr.
3
Add custom properties
Store enriched facts as Klaviyo custom profile properties.
4
Use in dynamic content
Reference enriched properties in Klaviyo email templates using Liquid.
Code Example
JavaScript / Node.js
// Klaviyo profile enrichment
const Klaviyo = require('klaviyo');
const client = new Klaviyo(process.env.KLAVIYO_API_KEY);
async function enrichKlaviyoProfile(email) {
// Get or create profile
const profile = await client.profiles.getOrCreate({ email });
// Enrich with Factr
const factrRes = await fetch('https://factr.polsia.app/api/enrich', {
method: 'POST',
body: JSON.stringify({ email, apiKey: process.env.FACTR_API_KEY })
});
const { fact } = await factrRes.json();
// Update profile properties
await client.profiles.update(profile.id, {
properties: { enriched_fact: fact }
});
}
Key Benefits
- Higher email open and click rates
- Personalized product recommendations
- Segment customers by enriched data
- Reduce cart abandonment with context