Overview
The Mailchimp Import script template pulls information from Mailchimp into Civis Platform. Currently, this script template only supports importing data about members in a specific Mailchimp list (using “list members info” from the Mailchimp Marketing API).
Key Features
- Pull member data from a specified audience by providing a list id
- Do full or partial syncs constrained by dates using incremental sync
- Change behavior of created tables to drop, upsert, append data as needed
Getting Started
Create your script by visiting this link and selecting “New custom script” from the top right. You’ll need to set up a Mailchimp API key and store that information in a Civis custom credential. See below for instructions on how to set up your Mailchimp API key. You’ll need some other information from your Mailchimp account, so keep it in a separate tab while filling in the parameters of your custom script.
Parameters
- Mailchimp API key (required): API key used for connecting to the mailchimp Marketing API stored in a Civis credential
- Data center (required): First part of the url when on your mailchimp dashboard. For example if your url is "us18.admin.mailchimp.com", your data center is "us18"
- Audience ID (required): The ID of the list you want to import. On Mailchimp this is found under audience > all contacts > settings > audience name and defaults > audience ID.
- Database (required): Civis database to write data to.
- Database Credential (required): A valid database credential for the cluster.
- Schema and Table name (required): The schema and table name you would like to import the data into, e.g. “schema.table”.
- Max errors(optional): The maximum number of rows with errors to remove from the Civis Platform table import before failing. Defaults to 0 (i.e., no errors allowed).
-
Existing table rows(optional): The action to take if a table with the requested name already exists. Defaults to Fail. Options are:
- Fail: The sync job fails if the table exists.
- Append: Records will be appended to the existing table
- Drop: Removes the entire table including column information.
- Upsert: Update or insert records into the specified table. The upsert mode modifies the table by leveraging the Mailchimp record Id (primary key) as well as last_changed (last modified keys) to modify existing records or add new ones. Visit Upsert Mode for more information on how it works.
Setting up your API Key
- Create a Mailchimp API key
- Follow the instructions here to generate an API key. You will need this key in the next step, so save it somewhere safe.
- Create a Mailchimp credential on platform
- To create a Mailchimp API credential on Civis, navigate to create new credential and fill the fields as follows:
- Name - The name for the credential. This will be what you select from the Credential dropdown on the import from Mailchimp script so make sure it’s descriptive. We recommend “<Your Organization> Mailchimp API Key”.
- Credential Type - Set the type to “Custom”.
- Username - This field may be left blank.
- Password - Your Mailchimp API key that you copied in step 1. If you did not save your API key, follow instructions here to revoke the key and then return to step 1 to create a new key.
- Description - Enter the credential description. This may be left blank.
- Remote Host must be left blank.
- Click Save.
Comments
0 comments
Please sign in to leave a comment.