ActiveCampaign Destination

ActiveCampaign is an integrated email marketing, marketing automation, and small business CRM. It allows you to send beautiful newsletters, setup behavioral based automations, and benefit from sales automation. This destination is maintained by ActiveCampaign. For any issues with the destination, please reach out to their team.

This document was last updated on March 27, 2018. If you notice any gaps, outdated information or simply want to leave some feedback to help us improve our documentation, please let us know!

Getting Started

The first step is to make sure ActiveCampaign supports the source type and connection mode you’ve chosen to implement. You can learn more about what dictates the connection modes we support here.

WebMobileServer
📱 Device-mode
☁️ Cloud-mode
  1. From your Segment UI’s Destinations page click on “Add Destination”.
  2. Search for “Active Campaign” within the Destinations Catalog and confirm the Source you’d like to connect to.
  3. Add your API URL and API Key which can be found in your ActiveCampaign UI Settings page under the Developer tab.
  4. Since the Segment ActiveCampaign destination integration is 100% handled through Segment, you don’t need to install ActiveCampaign site tracking or event tracking Javascript code.

Page

If you haven’t had a chance to review our spec, please take a look to understand what the Page method does. An example call would look like:

analytics.page();

NOTE: A Page call will only work if Site Tracking is enabled. You can enable this by visiting the Tracking tab on the Settings page in your ActiveCampaign account.

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.

Identify

If you haven’t had a chance to review our spec, please take a look to understand what the Identify method does. An example call would look like:

analytics.identify('ze8rt1u89', {
  firstName: 'Zaphod',
  lastName: 'Beeblebrox',
  email: 'Zaphod@hotmail.com'
});

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.

Note: A new contact will only be created if the identify call has a name (firstName OR lastName) AND an email trait.

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.

  • firstName
  • lastName
  • 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.

analytics.identify('ze8rt1u89', {
  firstName: 'Zaphod',
  lastName: 'Beeblebrox',
  email: 'Zaphod@hotmail.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:

analytics.identify('ze8rt1u89', {
  firstName: 'Zaphod',
  lastName: 'Beeblebrox',
  email: 'Zaphod@hotmail.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.

analytics.identify('ze8rt1u89', {
  firstName: 'Zaphod',
  lastName: 'Beeblebrox',
  email: 'Zaphod@hotmail.com',
  lists: [
     {
       id: 1,
       status: 'active'
     },
     {
       id: 7,
       status: 'unsubscribed'
     }
  ]
});

Track

If you haven’t had a chance to review our spec, please take a look to understand what the Track method does. An example call would look like:

analytics.track('Clicked a button', {
  properties: {
    acValue: 'Signup button'
  }
})

NOTE: A Track call will only work if Event Tracking is enabled. You can enable this by visiting the Tracking tab on the Settings page in your ActiveCampaign account.

When you call track, we will send that event to ActiveCampaign as an event tracking event. The event parameter will be 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 above, the event name is Clicked a button and the value for the event is Signup button.


Personas

You can send computed traits and audiences generated through Segment Personas to this destination as a user property. To learn more about Personas, reach out for a demo.

For user-property destinations, an identify call will be sent to the destination for each user being added and removed. The property name will be the snake_cased version of the audience name you provide with a true/false value. For example, when a user first completes an order in the last 30 days, we will send an identify call with the property order_completed_last_30days: true, and when this user no longer satisfies we will set that value to false.

When the audience is first created an identify call is sent for every user in the audience. Subsequent syncs will only send updates for those users which were added or removed since the last sync.

Settings

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

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

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

Adding ActiveCampaign to the integrations object

To add ActiveCampaign to the integrations JSON object (for example, to filter data from a specific source), use one of the 1 valid names for this integration:
  • ActiveCampaign


  • Questions? Need help? Contact us!
    Can we improve this doc?
    Email us: docs-feedback@segment.com!