> Connect ActiveCampaign with your API URL and key to tag buyers, add them to lists, start automations and start deadline timers from an automation.

Source: https://plandalf.com/docs/automations/activecampaign

Automations

# ActiveCampaign

Connect your ActiveCampaign account so your Plandalf sequences can act on your contacts. When someone buys, a sequence can tag them, add them to a list or start an ActiveCampaign automation. The most common use is stopping a sales email sequence the moment someone pays: Plandalf tags the buyer, and your ActiveCampaign automation ends on that tag. When they're refunded, another sequence can remove the tag again.

## Before you start

-   An ActiveCampaign account, and an ActiveCampaign user who can open **Settings → Developer**. On most plans that means an admin user.
-   The tags, lists and automations you plan to use. The Add Tag step can also create new tags for you.
-   A Plandalf checkout to connect it to, if you want purchases to reach ActiveCampaign.

## Get your ActiveCampaign API URL and key

Plandalf needs two things from ActiveCampaign: your account's API URL and your API key. Both are on the same page.

1.  ### Open the Developer settings
    
    Log in to ActiveCampaign. Click **Settings** at the bottom left, then choose **Developer**.
    
2.  ### Copy the URL and key
    
    Under **API Access**, copy the **URL**, which looks like `https://youraccount.api-us1.com`, and the **Key**. The key belongs to your ActiveCampaign user. If you reset it, the old key stops working and you'll need to update the connection in Plandalf.
    

Paste the URL as ActiveCampaign shows it. Plandalf also accepts it without `https://` or with `/api/3` on the end, and your `youraccount.activehosted.com` address works too. Any other address is refused, so the key is only ever sent to ActiveCampaign.

## Connect ActiveCampaign

1.  ### Find ActiveCampaign in the Marketplace
    
    In Plandalf, open **Automations** in the sidebar and choose the **Marketplace** tab. Find **ActiveCampaign** under **Available now** and click **Connect**.
    
2.  ### Paste the URL and key
    
    In the **Connect ActiveCampaign** window, keep or change the **Integration name**, paste the URL into **API URL** and the key into **API Key**, then click **Connect**.
    
3.  ### Check the result
    
    Plandalf checks both with ActiveCampaign straight away by loading the user the key belongs to. When you see **ActiveCampaign connected**, choose **Build an automation** to start a sequence, or **Not now**.
    

Your connection now appears under **Automations → My apps**. You can connect more than one ActiveCampaign account; each step asks which account to use.

## Steps you can add

Every step takes the contact's email address. In a purchase sequence, insert `{{trigger.customer_email}}` from the variable menu.

The steps that add something (a tag, a list, an automation) create the contact first if ActiveCampaign doesn't have them yet, so you don't need a separate create step. They also save the contact's first and last name when you fill those in. Blank names are skipped, so an empty variable never wipes a name in ActiveCampaign.

Step

What it does

Fields

**Add Tag**

Adds one or more tags, creating the contact and any new tags as needed. A typed tag name uses the tag with that name if you already have one, ignoring capitals, and creates it otherwise. Typed names can use variables.

Email Address and Tags (required), First Name, Last Name

**Remove Tag**

Removes a tag, for example after a refund. If the email isn't in ActiveCampaign, or the contact doesn't have the tag, the step is skipped, not failed.

Email Address and Tag (required)

**Add Contact to List**

Subscribes the contact to a list, creating the contact if needed.

Email Address and List (required), First Name, Last Name

**Add Contact to Automation**

Starts an ActiveCampaign automation for the contact, creating the contact if needed. The automation must be active; inactive ones show **(inactive)** in the list.

Email Address and Automation (required), First Name, Last Name

**Plandalf doesn't start from ActiveCampaign events**

The ActiveCampaign app has steps but no triggers: an ActiveCampaign event, such as a tag being added, can't start a Plandalf sequence through the app. To start a deadline timer from an ActiveCampaign automation, use its Webhook step, as shown below. Plandalf also doesn't create deals or send orders to ActiveCampaign's ecommerce features.

## Example: stop the sales emails when someone buys

This is the setup for a 5-day sales sequence that should stop the moment a contact buys.

1.  ### Add the template
    
    Go to **Automations → Templates**, find **Tag buyer in ActiveCampaign** and click **\+ Add**. Pick the checkout you're selling. Plandalf creates a sequence that runs on **Checkout Completed** for that checkout, with an **Add Tag** step already set to `{{trigger.customer_email}}` and a tag named "Bought" plus the checkout's name.
    
2.  ### Check the tag
    
    Open the **Add Tag** step. Keep the tag, or pick or type the one you want. The tag is created in ActiveCampaign the first time a buyer comes through.
    
3.  ### End the ActiveCampaign automation on the tag
    
    In ActiveCampaign, open your sales automation and add a **Goal** at the end with the condition **Tags → Tag exists** and the same tag. Set it to jump there from anywhere in the automation, so a buyer skips the remaining emails. Instead of a Goal, you can add a second start trigger, **Tag is added**, that ends the automation.
    
4.  ### Test and turn it on
    
    Run the step's test. Testing makes a real change in ActiveCampaign, so use your own email. Then turn the sequence **On**.
    

Test purchases skip automations by default. To try the whole flow with a test card, open the sequence's **Settings**, switch on **Run on test purchases**, buy through the checkout's test link, and switch it off again when you're done.

## Start each contact's deadline timer from ActiveCampaign

If a [deadline timer](https://plandalf.com/docs/promos/overview) gives each contact their own deadline, an ActiveCampaign automation can start that timer when the contact enters it, and the same contact sees their own countdown in your emails.

1.  ### Create the enrolment automation
    
    In Plandalf, open the deadline timer and choose the **Emails** tab. With ActiveCampaign picked as the email platform, click **Create enrolment automation**. Plandalf creates a sequence with a **Webhook** trigger and an **Enroll in Promo** step whose **Ref** and **Email** are `{{trigger.contact.email}}`, because ActiveCampaign sends the contact as form fields. Copy the catch URL it shows, then turn the sequence **On**.
    
2.  ### Add a Webhook step in ActiveCampaign
    
    In ActiveCampaign, open the automation that sends the offer's emails. Directly under its start trigger, click **+**, open **Conditions and workflow** and choose **Webhook**. Paste the catch URL and click **Save**. Each contact's timer starts the moment the automation reaches this step.
    
3.  ### Put the countdown in your emails
    
    Paste the countdown image from the deadline timer's **Emails** tab into an HTML block in each email. It ends in `?ref=%EMAIL%`, ActiveCampaign's personalization tag for the contact's email, so each contact sees their own deadline.
    

If your enrolment automation was created before you picked ActiveCampaign, open its **Enroll in Promo** step and set **Ref** and **Email** to `{{trigger.contact.email}}`.

## Remove the tag on refund

Take the tag back from refunded buyers with the [Remove access on refund](https://plandalf.com/docs/automations/templates#remove-access-on-refund) template.

1.  ### Add the template
    
    Go to **Automations → Templates**, find **Remove access on refund** and click **\+ Add**. Pick the same checkout as your purchase sequence. Plandalf creates the sequence and opens it.
    
2.  ### Pick the tag
    
    Open the **Remove Tag** step. **Email Address** is already set to `{{trigger.customer_email}}`. Pick the tag your purchase sequence adds. To remove more than one tag, add another **Remove Tag** step for each.
    
3.  ### Turn it on
    
    The trigger is **Invoice Refunded** with **Full refunds only** on, so a partial refund leaves the tag alone. Turn the sequence **On**.
    

The template adds a removal step for every connected app that has one, so you may see steps for other apps in the same sequence. Set them up too, or delete the ones you don't need.

## Common errors

What you see

What to do

"ActiveCampaign rejected the API key" when connecting

Check the **API Key** is the one from **Settings → Developer**, and that the **API URL** is from the same page and the same account. Plandalf keeps the failed connection in **My apps**. Open it there, fix the details and choose **Test Connection**, rather than connecting again.

"The API URL must be your ActiveCampaign API address"

The URL isn't an ActiveCampaign address. Copy it from **Settings → Developer**; it looks like `https://youraccount.api-us1.com`.

"Not found in ActiveCampaign (HTTP 404)"

The API URL points at the wrong account name. Copy it again from **Settings → Developer**.

Steps fail after you reset the ActiveCampaign key

The old key stopped working. Open the connection in **My apps**, paste the new key and choose **Test Connection**.

"Email is empty"

The email field didn't resolve. Map it to `{{trigger.customer_email}}` or another step's email output, and check the trigger sample has an email.

"… is not a valid email address"

The email field resolved to something that isn't an email. Check which variable it uses.

"At least one tag is required"

**Tags** on **Add Tag** is empty, or every entry resolved to blank. Pick or type a tag.

"The selected ActiveCampaign tag no longer exists"

The tag was deleted in ActiveCampaign. Pick a tag again, or type its name to create it.

"Pick the ActiveCampaign tag to remove", "list" or "automation"

The picker on that step is empty. Choose one.

Remove Tag shows **skipped**

ActiveCampaign has no contact with that email, or the contact doesn't have the tag. Nothing needed changing.

Enroll in Promo fails with "requires a non-empty ref"

The enrolment step can't find the email in the webhook. Set **Ref** and **Email** to `{{trigger.contact.email}}`.

A step fails with a rate limit message

ActiveCampaign allows 5 requests a second per account. Plandalf retries twice automatically. If it still fails, re-run the step once the burst has passed. Add Contact to Automation only retries a rate limit, so a contact is never started in the same automation twice.

## Related guides

-   [Automations overview](https://plandalf.com/docs/automations/overview)
-   [Create a checkout](https://plandalf.com/docs/checkouts/create)
-   [Plandalf with ActiveCampaign](https://plandalf.com/platforms/activecampaign)

Something wrong or missing? Email [hello@plandalf.com](mailto:hello@plandalf.com).
