> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voucherify.io/llms.txt
> Use this file to discover all available pages before exploring further.

# ActiveCampaign

In this short tutorial, you will learn how to connect Voucherify and ActiveCampaign accounts. This integration enables you to sync customers and exchange data between both accounts. 

**The integration with ActiveCampaign consumes** [webhook limits](/guides/limits#webhooks) **for sending messages, but actions that are sent from ActiveCampaign to Voucherify consume** [API limits](/guides/limits#api-limits)**.**

You can send Voucherify codes to your ActiveCampaign account and later on share them with customers in an automated email campaign. To do so, you can use standard distribution or as a part of the referral program (distribution channel for rewards).

## Integrate Voucherify with ActiveCampaign

Open your Integrations tab in the Home section and expand ActiveCampaign integration.

Copy your API key and URL address (the endpoint) from ActiveCampaign settings.

<Warning>
  <Badge color="yellow">Integration credentials are hidden after saving</Badge>

  When you configure an external integration, API tokens and secret keys are only shown during setup.
  After you save the integration, these values are masked and cannot be viewed again in the Dashboard.

  This reduces the risk of exposing sensitive credentials through the user interface.

  Save your keys securely before closing the window.
</Warning>

Paste the copied data into Voucherify. **The API endpoint should start with `https://`.**

Click **Connect** and next synchronize contacts to Voucherify by mapping one of the ActiveCampaign fields (email or ID) to Voucherify customers. Confirm the mapping by clicking **Enable**. You can change the mapping later on.

<Note>
  Source\_id is a unique identifier for a customer in the Voucherify database. When you use validation rules that require customer verification, for example, "one redemption per customer," each time someone tries to redeem the code, Voucherify verifies if the source\_id attached to this customer wasn't already used to redeem the code in this campaign.
</Note>

When the mapping is ready, and API access data are in place, you can confirm integration. From now on, you can use ActiveCampaign as a channel in [Voucherify distributions](https://support.voucherify.io/article/19-how-does-the-distribution-manager-work) and as a channel for automatic delivery of [referral rewards](https://support.voucherify.io/article/161-how-to-create-referral-program-step-by-step).

You can test the integration by adding a new contact to your ActiveCampaign account and then checking whether the new contact appeared in Voucherify. 

<Note>
  The integration will only synchronize the contacts added after the integration is confirmed. It will not automatically map old contacts. You can upload your ActiveCampaign contacts by a [CSV import](/prepare/customers).
</Note>

**Before you create Voucherify Distribution and map codes, you need to add the necessary custom fields to ActiveCampaign profiles. The fields will represent code attributes.**

## Mapping Voucherify codes

In the [Distribution Manager](https://support.voucherify.io/article/19-how-does-the-distribution-manager-work), you can choose ActiveCampaign as a distribution channel. As a result, Voucherify will deliver codes to customer profiles in your ActiveCampaign account. Then, you can send these codes to your customers using ActiveCampaign email templates. 

After choosing the channel, you can see the voucher attributes such as publication (sending) date, balance (value) of the code, and finally, the code itself. To map code attributes, choose the fields added to the ActiveCampaign. If you can't choose ActiveCampaign as a channel, check if you added your custom fields to ActiveCampaign profiles. Go to the ActiveCampaign dashboard and choose **Lists** > **Manage Fields** and **Add Field**. 

You can add more fields that are going to represent:

* Code of the published voucher (already added). 
* Publication date. 
* Value of voucher. 

<Note>
  Visit [this tutorial](https://www.activecampaign.com/learn/guides/what-are-custom-fields) to learn more about fields in ActiveCampaign.
</Note>

## Distribution with ActiveCampaign

After adding the field, you can use it in [Voucherify Distribution](https://support.voucherify.io/article/19-how-does-the-distribution-manager-work). 

Let's create a distribution of \$25 discount codes for all new customers via ActiveCampaign. 

* Choose a distribution trigger – customer entering segment.
* Select the action – send codes from the campaign.
* Build a [segment](/prepare/customer-segments) of message receivers – to attach a code to every new customer in ActiveCampaign create a segment with filter ***Source*** *is ActiveCampaign*.

In Channels, select ActiveCampaign. 

Enable ActiveCampaign as your distribution channel and proceed to map fields. 

Now, Voucherify codes from the given campaign will be published (assigned) to a single customer profile the moment they enter the predefined customer segment.

You can also use ActiveCampaign as a channel that delivers rewards to referrers. Choose ActiveCampaign as a notifications channel and send rewards to customer profiles in ActiveCampaign. Same as before, a code will be presented in the customer profile as a custom field.
