Skip to main content

Klaviyo Integration

Connect OneTap Login to Klaviyo to automatically add Google sign-in users to your email list. Klaviyo is particularly powerful for e-commerce stores.

Prerequisites​

  • Klaviyo account (free tier available)
  • At least one list created
  • API key generated

Step 1: Get Klaviyo API Key​

1.1 Access API Settings​

  1. Log into Klaviyo
  2. Click Settings (gear icon)
  3. Click API Keys

1.2 Create Private API Key​

  1. Click Create Private API Key
  2. Name it "OneTap Login"
  3. Select scopes:
    • Lists: Read/Write
    • Profiles: Read/Write
  4. Click Create
  5. Copy the key

API Key Format:

pk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Private Key

Use a Private API Key, not Public API Key. The Public key cannot write subscribers.

Step 2: Get List ID​

2.1 Find Your List​

  1. Go to Audience > Lists & Segments
  2. Click on your target list
  3. Click Settings tab

2.2 Copy List ID​

The List ID is shown in settings:

List ID: XxXxXx

Or in the URL:

https://www.klaviyo.com/list/XxXxXx/
^^^^^^
List ID

Step 3: Configure OneTap Login​

3.1 Access Settings​

  1. Go to WordPress Admin
  2. Navigate to Settings > OneTap Login
  3. Click Integrations tab
  4. Find Email Marketing section

3.2 Enter Credentials​

Klaviyo Settings

  1. Enable Email Marketing: Toggle on
  2. Provider: Select Klaviyo
  3. API Key: Paste your Private API key
  4. List ID: Enter your List ID

3.3 Test Connection​

  1. Click Test Connection
  2. Verify success message
  3. Click Save Changes

Configuration Options​

Double Opt-in​

Configure in Klaviyo:

  1. Go to Settings > Email
  2. Under Double Opt-In, enable it
  3. Customize confirmation email

Klaviyo handles DOI automatically when enabled.

Profile Properties​

Klaviyo receives:

OneTap FieldKlaviyo Property
Email$email
First Name$first_name
Last Name$last_name

Custom Properties​

Add custom profile properties:

{
"signup_source": "google_onetap",
"signup_date": "2024-01-15"
}

Subscriber Flow​

With Double Opt-in​

1. Profile created in Klaviyo
2. Added to list (not confirmed)
3. DOI email sent by Klaviyo
4. User confirms
5. Status: Subscribed

Without Double Opt-in​

1. Profile created
2. Added to list
3. Status: Subscribed immediately

Verification​

Check Profile​

  1. Go to Klaviyo Profiles
  2. Search for test email
  3. Verify profile exists
  4. Check list membership

Check Activity​

  1. Click on profile
  2. View Activity Feed
  3. See subscription event

Klaviyo for E-commerce​

WooCommerce Integration​

If you also use Klaviyo's WooCommerce plugin:

  • Profiles sync automatically
  • Order data flows to Klaviyo
  • OneTap adds signup source

Event Tracking​

Klaviyo tracks these events:

  • Profile created
  • Added to list
  • (With WC plugin) Placed Order, etc.

Segments​

Create segment of Google users:

  1. Go to Lists & Segments
  2. Create segment
  3. Condition: Properties > signup_source equals google_onetap

API Rate Limits​

Klaviyo limits:

  • 75 requests/second
  • 700 requests/minute

More than enough for OneTap usage.

Error Messages​

"Invalid API Key"​

Cause: Wrong or inactive API key.

Solution:

  1. Verify using Private key (not Public)
  2. Check key starts with pk_
  3. Verify key hasn't been revoked

"List Not Found"​

Cause: Wrong List ID.

Solution:

  1. Verify List ID in Klaviyo
  2. Check list isn't archived
  3. Copy ID from list settings

"Profile Suppressed"​

Cause: Email is on suppression list.

Solution: Check Klaviyo suppression lists. This might be expected for bounced/unsubscribed emails.

Cause: Consent issues.

Solution: Ensure marketing consent is properly captured.

Klaviyo-Specific Features​

Flows (Automations)​

Create welcome flow:

  1. Go to Flows
  2. Create from template or scratch
  3. Trigger: Added to List
  4. Add emails, delays, conditions

Predictive Analytics​

Klaviyo offers:

  • Customer lifetime value prediction
  • Churn risk scoring
  • Next purchase prediction

Works best with order data.

SMS Marketing​

Klaviyo supports SMS:

  1. Enable SMS in Klaviyo settings
  2. Collect phone numbers
  3. Add to SMS consent list

OneTap doesn't capture phone by default.

Catalog/Product Feeds​

For e-commerce:

  1. Sync product catalog
  2. Send product recommendations
  3. Abandoned cart emails

Integration Code​

How OneTap Calls Klaviyo​

// Simplified example - Creating profile and adding to list
$response = wp_remote_post(
'https://a.klaviyo.com/api/profiles/',
[
'headers' => [
'Authorization' => 'Klaviyo-API-Key ' . $api_key,
'Content-Type' => 'application/json',
'revision' => '2024-02-15'
],
'body' => json_encode([
'data' => [
'type' => 'profile',
'attributes' => [
'email' => $email,
'first_name' => $first_name,
'last_name' => $last_name,
'properties' => [
'signup_source' => 'google_onetap'
]
]
]
])
]
);

// Then add to list
$profile_id = json_decode($response['body'])->data->id;

wp_remote_post(
"https://a.klaviyo.com/api/lists/{$list_id}/relationships/profiles/",
[
'headers' => [...],
'body' => json_encode([
'data' => [
['type' => 'profile', 'id' => $profile_id]
]
])
]
);

Troubleshooting​

Connection Test Fails​

  1. Verify Private API key (pk_...)
  2. Check API key has correct scopes
  3. Ensure account is active
  4. Try new API key

Profile Not in List​

  1. Verify list ID
  2. Check profile exists in Klaviyo
  3. Verify list isn't archived
  4. Check API response logs

Duplicate Profiles​

Klaviyo dedupes by email automatically. You shouldn't see duplicates.

Best Practices​

Do's​

  • Use Private API key
  • Enable double opt-in for GDPR
  • Set up welcome flow
  • Track signup source
  • Integrate WooCommerce plugin too

Don'ts​

  • Don't use Public API key
  • Don't skip DOI for EU
  • Don't archive active lists

Next Steps​