ActiveCampaign Destination

Segment makes it easy to send your data to ActiveCampaign (and lots of other destinations). Once you've tracked your data through our open source libraries we'll translate and route your data to ActiveCampaign in the format they understand. Learn more about how to use ActiveCampaign with Segment.

This destination is maintained by ActiveCampaign.

Getting Started

Once the Segment library is integrated with your server, toggle ActiveCampaign on in your Segment Destinations tab and add your API URL and API Key. You can find both of these in your ActiveCampaign account on the My Settings page under the API tab.

The Segment ActiveCampaign destination integration is 100% handled through Segment, so you don’t need to install ActiveCampaign site tracking or event tracking Javascript code.

ActiveCampaign supports the identify, track, and page methods.


Identify

If the contact you are passing in doesn’t already exist in your ActiveCampaign account, they will automatically be added through this method. If the contact does already exist, they will simply be updated.

Basic Fields

When you identify a contact, we’ll pass that contact’s information to ActiveCampaign with userId as ActiveCampaign’s External User ID. ActiveCampaign accepts these basic fields from Segment.

  • first_name
  • last_name
  • email
  • phone

Tags

You can add tags to a contact by passing in a trait called tags. If you would like to delete all tags currently on a contact, you can pass in a trait called tagsReset with a value of 1. You can pass both tags and tagsReset if you wish, or just one of the two. If you pass both, all tags will be deleted and then any new tags will be added.

{
  "type": "identify",
  "userId": "12345",
  "traits": {
    "firstName": "Peter",
    "lastName": "Gibbons",
    "email": "peter@initech.com",
    "tags" : [
          "checkout",
        "abandoned"
      ],
    "tagsReset": "1"
  }
}

Custom Fields

ActiveCampaign also supports updating a contact’s custom fields with this integration. To send custom fields to ActiveCampaign you need to create the custom field first in ActiveCampaign for each custom field you want to send. Then when you call identify with keys that match those traits, those custom fields for the contact will be updated.

For example, if you have a contact in ActiveCampaign with these custom fields:

You can update those fields using this identify call:

{
  "type": "identify",
  "userId": "12345",
  "traits": {
    "firstName": "Peter",
    "lastName": "Gibbons",
    "email": "peter@initech.com",
    "shirtSize": "medium",
    "state": "California",
    "multiChoice": [Value1, Value2]
  }
}

In the example these traits are shirt size, state, and multiChoice. They will be shown as %SHIRT_SIZE%, %STATE%, and %MULTI_CHOICE% in ActiveCampaign, but you can record them in lower-case to identify and they will still be populated. The multiChoice field applies to listbox or checkbox custom fields in ActiveCampaign (where more than one option value is allowed).

If your custom field has the same name as a reserved trait, that custom field will not be updated.

Lists

You can add a contact to or unsubscribe a contact from any number of lists by passing in a trait called lists. As shown in the example below, this trait should be an array, with each element having an id and a status. The value of status must be either active or unsubscribed.

{
  "type": "identify",
  "userId": "12345",
  "traits": {
    "firstName": "Peter",
    "lastName": "Gibbons",
    "email": "peter@initech.com",
    "lists" : [
        {
          "id" : "1",
          "status" : "active"
        },
        {
          "id" : "7",
          "status" : "unsubscribed"
        }
      ]
  }
}

Track

Note: in order for the Track call to work, you need to have Event Tracking enabled in your ActiveCampaign account. You can enable this by visiting the Tracking tab on the My Settings page in your ActiveCampaign account. This page is accessible via the menu under your avatar in the top right.

When you track an event, we will send that event to ActiveCampaign as an event tracking event. The event parameter will be the event tracked for the contact with the email parameter. If you want to pass a value for that event, you can pass the value in as the acValue property of properties. In the example below, the event name is Clicked a button and the value for the event is Signup button.

{
  "type": "track",
  "event": "Clicked a button",
  "properties": { "acValue": "Signup button"}
}

Page

Note: in order for the Page call to work, you need to have Site Tracking enabled in your ActiveCampaign account. You can enable this by visiting the Tracking tab on the My Settings page in your ActiveCampaign account. This page is accessible via the menu under your avatar in the top right.

When you call page, we will send that event to ActiveCampaign as a site tracking event. The referrer and url parameters will be tracked for the contact with the email parameter.


Supported Sources and Connection Modes

WebMobileServer
📱 Device-based
☁️ Cloud-based

To learn more about about Connection Modes and what dictates which we support, see here.

Settings

Segment lets you change these destination settings via your Segment dashboard without having to touch any code.

API url

Your API url can be found by navigating to your Active Campaign account and clicking on My Settings > API. It should look something like https://<account-name>.api-us1.com

direct

endpoint

API Key

Your API key can be found by navigating to your Active Campaign account and clicking on My Settings > API. It should look something like 5292218aadbe410acf66c44164c4be2de4bbf184c509ef699d85a0e8da1d9fabeda175df


If you have any questions or see anywhere we can improve our documentation, please let us know or kick off a conversation in the Segment Community!