ActiveCampaign Integration
Add or update a contact in ActiveCampaign with list and tag assignment.
Action type: activecampaign
Class: Core_Forms\Actions\ActiveCampaign
Source: src/actions/class-activecampaign.php
Setup
- In ActiveCampaign, go to Settings > Developer.
- Copy your API URL (e.g.,
https://yourname.api-us1.com) and API Key. - In WordPress, edit your form > Actions tab > Add Action > Add to ActiveCampaign.
- Enter the API URL, API Key, and configure field/list/tag settings.
Settings Reference
| Setting | Required | Default | Description |
|---|---|---|---|
| API URL | Yes | -- | ActiveCampaign account API URL (https://yourname.api-us1.com) |
| API Key | Yes | -- | ActiveCampaign API key |
| List ID | No | -- | List ID to add the contact to |
| Tag IDs | No | -- | Comma-separated tag IDs to apply |
| Email Field | No | email |
Form field name containing the email address |
| Name Field | No | name |
Form field name containing the full name |
Internal settings (not shown in UI):
| Setting | Default | Description |
|---|---|---|
phone_field |
-- | Form field name containing phone number |
Name Handling
The Name Field value is split on the first space:
- First word becomes firstName
- Remaining words become lastName
Contact Sync
The integration uses the contact/sync endpoint (/api/3/contact/sync), which creates a new contact or updates an existing one based on email address. This is an upsert operation.
List Assignment
If a List ID is provided, the contact is added to the list with status 1 (active) via the /api/3/contactLists endpoint. The list assignment is a separate API call after the contact is created/updated.
Tag Assignment
Tags are applied individually. Each tag ID triggers a separate API call to /api/3/contactTags. Find tag IDs in ActiveCampaign under Contacts > Tags.
1,2,3
How It Works
- Validates API URL, API Key, and email.
- Creates or updates the contact via
/api/3/contact/sync. - Extracts the contact ID from the response.
- If a List ID is configured, adds the contact to the list.
- If Tag IDs are configured, applies each tag individually.
- All requests use the
Api-Tokenheader for authentication. - The request times out after 15 seconds per API call.
- Returns
trueif the contact was created/updated successfully.
Example
Form with name, email, and phone fields:
- API URL:
https://myaccount.api-us1.com - API Key:
your_api_key_here - List ID:
1 - Tag IDs:
5,12 - Email Field:
email - Name Field:
name
This creates/updates the contact, adds them to list 1, and applies tags 5 and 12.
Troubleshooting
- Contact not created: Verify the API URL includes the protocol (
https://) and has no trailing slash. - Tags not applied: Tags must exist in ActiveCampaign. The IDs are numeric, not tag names.
- "Unauthorized": Check that the API key is correct and has not been regenerated.
- Phone not saved: Set the
phone_fieldsetting. This is not exposed in the UI by default.