The Scenario
You manage paid acquisition. Your Facebook Ads team is running a lookalike audience campaign, and the best seed audience you have is Klaviyo's "High LTV Customers" segment — roughly 3,000 profiles of customers who have spent above a certain lifetime value threshold. To create a Facebook custom audience, you need those profiles exported as a CSV with email, first name, and phone number. The data is in Klaviyo. Getting it into a format Facebook's Ads Manager will accept is the problem.
The bad version:
- Log into Klaviyo, navigate to the segment, and look for an export button — find that exporting segment members requires going through the Profiles section, which does not let you filter down to a single segment and export in one step.
- Use Klaviyo's API documentation to find the segment profiles endpoint, write a pagination loop to pull all 3,000 profiles in batches of 100, and stitch the pages together into a single CSV.
- Reformat the phone column from whatever format Klaviyo returns into the E.164 format Facebook requires, then upload to Ads Manager.
The lookalike campaign has a launch date. The seed audience is sitting three API calls away from a spreadsheet.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent that lives inside your Google Sheet. It handles the pagination across 3,000 profiles and writes them directly into the sheet — no API script needed.
Export all profiles from Klaviyo segment ID seg123 and write each profile's email, first name, and phone number into this sheet
What You Get
- All 3,000 segment members are pulled across paginated API calls and written as one row per profile.
- Columns contain email, first name, and phone number in the format Klaviyo returns.
- The sheet is ready for Facebook Ads Manager upload, with an optional reformatting prompt if the phone format needs adjustment.
What If the Data Is Not Quite Ready
You need city and country for geographic targeting as well
Fetch all members of the Klaviyo segment named "High LTV Customers" and populate columns A through D with email, external_id, city, and country
Phone numbers need E.164 formatting for Facebook
Export all profiles from Klaviyo segment ID seg123, write email (column A), first name (column B), and phone (column C), then normalize column C to E.164 format before writing
The segment ID is not known — you only have the segment name
Export all profiles from the Klaviyo segment named "High LTV Customers" and write email, first name, and phone into columns A through C — look up the segment ID from the segment name first
Full Facebook custom audience prep in one pass
Export all profiles from the Klaviyo segment named "High LTV Customers"; write email (A), first name (B), phone number normalized to E.164 (C), and country (D); remove any rows where email is blank; write the total profile count at the bottom of column A
The seed audience is ready to upload. The lookalike campaign launches on time.
Try It
Get the 7-day free trial of SheetXAI and open a blank Google Sheet when you need your next Klaviyo segment for an ad campaign, then ask it to pull and format the profiles in one pass. Also see how to bulk suppress opt-out contacts to keep that seed audience clean.
