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

# Campaigner

> Enrich Campaigner with data from your warehouse to build robust email marketing campaigns to drive higher ROI and grow your audience.

## Overview

Providing relevant and timely campaigns relies on fresh and accurate data in your Campaigner account. By automatically syncing customer data from your data warehouse into Campaigner, you don't need to worry about data consistency or staleness. Instead, you can focus on building world-class customer experiences.

## Connect to Campaigner

**Create an API user and retrieve the API Token from Campaigner.**

1. Log in to Campaigner.
2. Visit [Campaigner's Users Settings Page](https://secure.campaigner.com/CSB/Account/AccountUsers.aspx).
3. Click on **Create New User**.

   ![Fill out User Information and select role](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-campaigner-user-info.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=e55051aef78246889b46c5924a6550c5)
4. Select **API user** from the **User Role** dropdown select, and fill out the information required in the **User Profile** tab.
5. Click on **Create API Key**.

   ![Fill out User Information and select role](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-campaigner-ip-whitelist.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=0d1e99533e38d2f8b5b50a244296b327)
6. Add the [Hightouch IP Addresses](https://docs.hightouch.com/security/networking#ip-addresses) to the IP Allowlist and click **Save**.

   ![Fill out User Information and select role](https://mintcdn.com/hightouch-3c037897/L_vQfA0JQEpeGUUo/images/destinations/destination-campaigner-api-key.png?fit=max\&auto=format\&n=L_vQfA0JQEpeGUUo\&q=85\&s=211046e6519f9719d3abb4785a125a39)
7. Click on the newly created user and head to the **API Keys** tab and copy the API key.

#### Add Campaigner as a destination in Hightouch

1. Log in to Hightouch or create a free Hightouch account
2. Click on **Destinations** in the left sidebar
3. Click on **Add destination** in the top right corner
4. Select **Campaigner** in the destination catalog and click **Continue** to proceed
5. Paste your **API Key** and click **Continue** to proceed
6. Give your destination a name and unique slug (for example, Campaigner Production” and `Campaigner-production`)
7. Click **Finish** to create your Campaigner destination.

### Connect to your data source

Hightouch sits on top of your data warehouse and can read from Snowflake, Redshift, BigQuery, Databricks, Postgres, MySQL, and many other data sources. You can even fetch data from Google Sheets and Airtable. Hightouch can help activate your data wherever it resides.

We've written dedicated guides for each supported data source. Take your pick:

* Connect to [Airtable](https://docs.hightouch.com/sources/airtable)
* Connect to [Amazon Athena](https://docs.hightouch.com/sources/amazon-athena.md)
* Connect to [Amazon Redshift](https://docs.hightouch.com/sources/amazon-redshift.md)
* Connect to [ClickHouse](https://docs.hightouch.com/sources/clickhouse.md)
* Connect to [Databricks](https://docs.hightouch.com/sources/databricks.md)
* Connect to [Elasticsearch](https://docs.hightouch.com/sources/elasticsearch)
* Connect to [Firebolt](https://docs.hightouch.com/sources/firebolt)
* Connect to [Google BigQuery](https://docs.hightouch.com/sources/google-bigquery.md)
* Connect to [Google Sheets](https://docs.hightouch.com/sources/google-sheets.md)
* Connect to [Looker](https://docs.hightouch.com/sources/looker)
* Connect to [Metabase](https://docs.hightouch.com/sources/metabase)
* Connect to [MySQL](https://docs.hightouch.com/sources/mysql.md)
* Connect to [PostgreSQL](https://docs.hightouch.com/sources/postgresql.md)
* Connect to [Rockset](https://docs.hightouch.com/sources/rockset)
* Connect to [SFTP](https://docs.hightouch.com/sources/sftp.md)
* Connect to [Snowflake](https://docs.hightouch.com/sources/snowflake.md)
* Connect to [SQL Server](https://docs.hightouch.com/sources/sqlserver.md)
* Connect to [Trino](https://docs.hightouch.com/sources/trino.md)

> [!NOTE]
>
> If you're missing the credentials necessary to connect to your data source,
> try inviting your teammates to Hightouch. You can have unlimited collaborators
> in your workspace.

#### Connect to a sample database instead

Waiting for credentials to your data warehouse? No problem. You can connect to one of our [sample datasets](https://docs.hightouch.com/sources/sample-data.md) to get started right away. For the rest of this tutorial, we'll use the **B2B SaaS** sample source, which contains a `users` table with names, emails, locations, and other user attributes. This sample source is available when you log in for the first time—no setup required.

Next, we'll write a SQL query to define which users should be synced to our Campaigner customers resource. You can follow the same pattern to sync to other support Campaigner resources,

### Create a model

In Hightouch, a model represents a query that filters or transforms the records in your data source. Models are used to determine exactly which records to sync between sources and destinations.

When you connect to a data warehouse, your models will probably be written in SQL. You can also import models from tools like dbt and Looker.

In this example, we'll keep it simple. Suppose you want to sync all your customers to Campaigner. To accomplish this, you'll want to create a model that looks like this:

```sql theme={null}
SELECT * FROM users;
```

1. Click on **Models** in the left sidebar.
2. Click on **Add model** in the top right corner.
3. Select **Demo Database** as your source and click **Continue** to proceed.
4. Select **SQL Editor** as your modeling method.
5. Paste the SQL query from above into the editor on the left side of the page.
6. Click **Preview** to execute the query.
7. Click **Continue** to proceed.
8. Give your model a name and unique slug (for example, "All Users" and `all-users`).
9. Select **ID** as the primary key for your model.
10. Click **Finish** to create your model.

We just created a model using a SQL query that retrieves all our current users. Next, we'll configure our sync to add these users to Campaigner.

### Create a sync

1. Click on **Syncs** in the left sidebar.
2. Click on **Add sync** in the top right corner.
3. Select **All Users** as your model and click **Continue** to proceed.
4. Select **Campaigner** as your destination and click **Continue** to proceed.

## Sync configuration

### Syncing subscribers object

#### Object selection

Hightouch supports syncing to the following Campaigner resources:

* **Subscribers**. Also referred to as **Contacts** on Campaigner.

#### Sync modes

This integration supports **Upsert** and **Update**.

* In **Upsert** mode, records that aren't found in Campaigner given the provided identifier will be inserted. And existing records will be updated.

* In **Update** mode, only records that are found in Campaigner given the provided identifier will be updated.

#### Record matching

* Records can be matched from your source to your Campaigner workspace by `Email`.

#### Field mapping

Hightouch allows you to sync columns from your source to the supported Campaigner fields. You can map fields in Campaigner that aren't in the table below using [custom field mapping](#custom-field-mapping).

| Mapping | Type | Description |
| :- | :-: | -: |
| `Source ID` | Number | The ID of a valid Source this subscriber should be associated with. |
| `Publications` | Array | An array of Publication IDs to be associated with the subscriber. |
| `Lists` | Array | An array of List IDs to be associated with the subscriber. |
| `Orders` | Array | An array of [order objects](https://media.campaigner.com/apidocs/edapi/#OrderAdd). |
| `Force` | Boolean | If the Force parameter is **true**, "Removed" or "Bounced" subscriber statuses will be ignored and set back to "Active" |
| `Force Publications` | Boolean | Set this property to **true** if you want to force this subscriber back into a publication they might have previously requested removal from. |

#### Custom field mapping

Hightouch allows you to set custom attributes. Any mappings from this section will be synced as custom fields. Campaigner expects custom properties to follow a `PascalCase` format for both *new* and *existing* custom fields. For example, if `First Name` exists as a field in Campaigner, enter `FirstName` in our mapper. Use the same format for custom fields you want Hightouch to create in Campaigner.

#### Delete records

When the Hightouch sync engine recognizes that a record has been removed from your source, you can either:

In **Upsert** mode:

* Do Nothing.
* Clear fields that are being synced in the destination.
* Delete record in the destination.

In **Update** mode:

* Do Nothing.
* Clear fields that are being synced in the destination.

> [!WARNING]
>
> Clearing fields in Campaigner through Hightouch will not clear existing
> Publications and Lists from the Subscriber's record. However, It will reset
> the Source ID, and return the boolean mappings:`Force Publications` and
> `Force` to their default if they exist in your mappings.

### Syncing mailing lists

* Create a mailing list and/or add subscribers with the **Mailing Lists** integration. Note that contacts must already exist in your Campaigner account to be synced to a mailing list.

#### Record matching

* Records can be matched from your source to your Campaigner workspace by `Email`.

#### Create a new mailing list

* To create a new mailing list, select `Create a new segment`.
* You can provide a name for this mailing list, or Hightouch will use the name of the model used to create the sync.

#### Use an existing mailing list

* To use an existing mailing list, select `Use existing segment`.
* You can select any of your **active** Campaigner mailing lists from the drop-down select menu.
* If you'd like to sync to segments dynamically, click `Use Column` and pick a column from your model that contains the Campaigner `Mailing List ID`.

### Syncing suppression lists

* Add subscribers to suppression lists with **Suppression Lists** integration.

#### Record matching

* Records can be matched from your source to your Campaigner workspace by `Email`.

#### Use an existing suppression list

* Campaigner doesn't provide the ability to create suppression lists programmatically.
* You can select any of your **active** Campaigner suppression lists from the drop-down select menu.

## Tips and troubleshooting

To see the exact API requests and responses from each sync run, use the [live debugger](https://docs.hightouch.com/syncs/debugger.md). To get notified by Slack, PagerDuty, SMS, or email when a sync fails, set up [sync alerts](https://docs.hightouch.com/syncs/alerting.md). If you run into an issue this page doesn't cover, [contact support](#pylon-chat).

## Common errors

### Error: 101 Email address has been screened out

You may see this error on records that were rejected during an otherwise successful sync run. This is frequently due to improper formatting (`@com.com`) or other common email validation checks.
