Skip to main content

MailChimp Integration

Connect OneTap Login to MailChimp to automatically add Google sign-in users to your email list.

Prerequisites

  • MailChimp account (free tier works)
  • At least one audience (list) created
  • API key generated

Step 1: Get MailChimp API Key

1.1 Access API Keys

  1. Log into MailChimp
  2. Click your profile icon (bottom left)
  3. Click Profile
  4. Click Extras > API keys

1.2 Create API Key

  1. Scroll to "Your API keys"
  2. Click Create A Key
  3. Name it "OneTap Login"
  4. Copy the key immediately
Save Your Key

The API key is only shown once. Copy it immediately and store securely.

API Key Format:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-us1

The suffix (us1, us2, etc.) indicates your data center.

Step 2: Get Audience ID

2.1 Find Your Audience

  1. Go to Audience > All contacts
  2. Click Settings
  3. Click Audience name and defaults

2.2 Copy Audience ID

  1. Scroll to "Audience ID"
  2. Copy the ID

Audience ID Format:

a1b2c3d4e5

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

MailChimp API Key Field

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

3.3 Test Connection

MailChimp Test Connection

  1. Click Test Connection
  2. Verify "Connection successful" message
  3. Click Save Changes

Configuration Options

Double Opt-in

Enable DOI in MailChimp:

  1. Go to Audience > Settings
  2. Click Audience name and defaults
  3. Under "Form Settings"
  4. Enable Enable double opt-in

OneTap Login respects this setting automatically.

Tags

Add tags to new subscribers:

Setting: Tags to add Example: google-signup, new-customer

Tags are created automatically if they don't exist.

Merge Fields

Map user data to MailChimp merge fields:

OneTap FieldMailChimp Merge Field
First NameFNAME
Last NameLNAME
EmailEMAIL (automatic)

Standard merge fields (FNAME, LNAME) are used automatically.

Subscriber Status

With Double Opt-in Enabled

New subscriber → status: "pending"

Confirmation email sent

User clicks confirm

Status: "subscribed"

With Double Opt-in Disabled

New subscriber → status: "subscribed"

Verification

Check Subscriber Added

  1. Go to MailChimp Audience > All contacts
  2. Search for the test email
  3. Verify subscriber exists
  4. Check tags and merge fields

Check Activity Log

In MailChimp:

  1. Go to Audience > All contacts
  2. Click on subscriber
  3. View Activity tab
  4. See subscription source

API Rate Limits

MailChimp limits:

  • 10 concurrent connections
  • No hard request limit (fair use)
  • Batch operations for high volume

OneTap Login subscribes one at a time (per registration).

Error Messages

"API Key Invalid"

Cause: Wrong or expired API key.

Solution:

  1. Generate new API key
  2. Copy complete key including -usX suffix
  3. Update in OneTap settings

"List Does Not Exist"

Cause: Wrong Audience ID.

Solution:

  1. Verify Audience ID in MailChimp settings
  2. Check for typos
  3. Ensure audience isn't archived

"Member Exists"

Cause: Email already in audience.

Solution: This is normal for returning users. OneTap skips existing subscribers.

"Compliance State"

Cause: Email is on compliance hold.

Solution: Check MailChimp compliance settings or contact MailChimp support.

MailChimp-Specific Features

Groups

To add subscribers to a specific group:

  1. Get group ID from MailChimp
  2. Configure in OneTap settings (if available)
  3. Or use MailChimp automation to assign

Automations

Trigger automations on subscription:

  1. In MailChimp, create automation
  2. Set trigger: "Someone subscribes"
  3. Filter by tags (e.g., "google-signup")

Segments

Create segment of Google users:

  1. Go to Audience > Segments
  2. Create segment
  3. Condition: Tags > is > google-signup

Integration Code

How OneTap Calls MailChimp

// Simplified example
$response = wp_remote_post(
"https://{$dc}.api.mailchimp.com/3.0/lists/{$list_id}/members",
[
'headers' => [
'Authorization' => 'Basic ' . base64_encode("user:{$api_key}")
],
'body' => json_encode([
'email_address' => $email,
'status' => 'pending', // or 'subscribed'
'merge_fields' => [
'FNAME' => $first_name,
'LNAME' => $last_name
],
'tags' => ['google-signup']
])
]
);

Troubleshooting

Connection Test Fails

  1. Verify API key format (includes -usX)
  2. Check API key hasn't been deleted
  3. Verify account is active
  4. Try generating new API key

Subscribers Not Appearing

  1. Check DOI: User may need to confirm
  2. Verify correct audience selected
  3. Check MailChimp cleaned/bounced list
  4. Review OneTap debug logs

Tags Not Applied

  1. Verify tag names in settings
  2. Check for special characters
  3. Tags are created if they don't exist

Best Practices

Do's

  • Use double opt-in for GDPR compliance
  • Tag Google signups for segmentation
  • Set up welcome automation
  • Monitor subscription rates

Don'ts

  • Don't disable DOI for EU audiences
  • Don't use API key in public code
  • Don't ignore bounce/complaint rates

Next Steps