Skip to main content

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

  1. In ActiveCampaign, go to Settings > Developer.
  2. Copy your API URL (e.g., https://yourname.api-us1.com) and API Key.
  3. In WordPress, edit your form > Actions tab > Add Action > Add to ActiveCampaign.
  4. 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

  1. Validates API URL, API Key, and email.
  2. Creates or updates the contact via /api/3/contact/sync.
  3. Extracts the contact ID from the response.
  4. If a List ID is configured, adds the contact to the list.
  5. If Tag IDs are configured, applies each tag individually.
  6. All requests use the Api-Token header for authentication.
  7. The request times out after 15 seconds per API call.
  8. Returns true if 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_field setting. This is not exposed in the UI by default.