How to Integrate with MailChimp

Mailchimp is one of the most popular bulk emailing platforms, and through Zapier or other supported integration tools (that supports connecting Prefinery/Webhooks to Mailchimp) you can connect your Prefinery account to your Mailchimp one to automatically send and sync signups. 

Alternatively, you can export your Prefinery campaign users and import them into Mailchimp, or run a script to automatically add new Prefinery campaign users as subscribers in Mailchimp. 

Here's how: 

Setting up Zapier Integration

Here's how you can get started with a Prefinery-Mailchimp integration

1

Click here to go to Zapier's Prefinery-Mailchimp integration page. 

2

Under the  Connect Prefinery + Mailchimp in Minutes section, and like as shown below set the trigger to User Applied in Prefinery and the action to Add/Update Subscriber in Mailchimp. Click the Connect Prefinery + Mailchimp button that appears to go into the zap editor. 

Selecting User Applied means that the user has opted in via campaign confirmation email (if you have double opt-in enabled) or has expressed recent consent to be added to the campaign in some other way (if double opt-in is disabled). The zap/automation will not trigger for a particular user until their status in Prefinery changes to "Applied". We highly recommend that you enable double opt-in for the advantages it brings as described here, and this allows you to directly add users to Mailchimp without having to get their opt-in confirmation again. 

You may be asked to create your own Zapier account and/or login first to proceed. 

3

In the zap editor, you will first need to setup the trigger step which is Prefinery. A Prefinery trigger can be events like when a new user is added in Prefinery, when a user earns a reward, and a dozen other other possible options. You begin this by connecting your Prefinery account. Click on the Sign In to Prefinery button to continue. 

4

A new window will popup where you'll be asked to enter your unique Prefinery account API key. You can find this in your Prefinery dashboard by navigating to Settings > Company Settings > API Keys. You can also refer to our guide on creating an API key

Refer to our guide on creating an API key, copy the generated API Key (alphanumeric string) and paste it in Zapier's account connection window as shown above and click Yes, Continue. The Connect an Account window will automatically close if the connection is successful. 

Once done, back in the zap editor click on Continue in the trigger step section. 

5

Proceed with setting which Project the zap should trigger for, then Continue

6

Click on the Test trigger button to pull up a user entry from your campaign. 

If nothing shows up, make sure to add a test user in your campaign by signing up with an email address you use (you can just go to the Signup Form section in your Prefinery project dashboard and use the signup form there). With double opt-in enabled, make sure you've confirmed opt-in via email. Once done, try triggering the test in Zapier again. 

If your trigger test is successful, Zapier will display the pulled up information which as shown below includes the user's email address you can use later on to map/link to the email address field in Mailchimp. 

Click on Continue to proceed with setting up the Mailchimp action step. 

7

In the Mailchimp action step, click on Continue

Similar to what you did with connecting Prefinery to Zapier earlier, click on the Sign in to Mailchimp button and follow along the connection process which requires you to login to your Mailchimp account and authorize Zapier to access it. 

8

Once your Mailchimp account is connected, you can then setup the action step. Here you can select the Mailchimp Audience you want to add the Prefinery users to, then map the Prefinery user's email address as the Subscriber Email in Mailchimp by clicking on that field and selecting the Email entry from the trigger step. 

Other fields like Phone Number and Address can also be mapped if you are also collecting those information in Prefinery. 

Note: While our integration options provide you with lots of information you can send to a connected 3rd-party service, it is NOT recommended to sync the waitlist/leaderboard position to other systems. 

Optionally, you can also set Double Opt-in to False in for example the user has already opted in through your Prefinery campaign's confirmation email. 

Once done, scroll down to the bottom and click on Continue so you can test the action step. 

9

Click on the Test & Continue button to test your Mailchimp action step. 

You can then  Turn on Zap once the test goes through successfully. 

Exporting data in CSV format from Prefinery, Importing into Mailchimp

If you prefer to manually export your list of users from Prefinery to a CSV file and import them into the email software of your choice, or perhaps there are users that you'd like to add to your Mailchimp account prior to setting up the integration, here's how: 

1

In Prefinery, from your project dashboard navigate to Users

2

To export all users in your campaign, in the upper-right corner of the Users page, click on Action > Export. You don't have to select the users to export them all unless you need to only export the ones you've selected. 

To export a subset of your users (e.g. only those with the "Applied" status or have confirmed opt-in), you can use the Filter feature as shown below then exporting the users that match the filter. 

A prompt will appear. Click on Export to confirm the request. 

A notification like what's shown below will appear as confirmation of the export request. 

The CSV file will be emailed to your Prefinery account email address as soon as it's been processed. Below is an example of how the email looks. 

You can also access and download it through your dashboard via Settings > Project Settings > Exports

3

Once you have the CSV file, please refer to Mailchimp's guide here on how to import contacts into your Mailchimp account using the CSV file

Running a script to add Prefinery campaign user as Mailchimp subscriber

Mailchimp offers signup forms you can use to add users into your mailing list. Using URL parameters you can pre-fill this form with input values when the URL is visited. 

Furthermore, using Prefinery's Signup Form JavaScript feature, you can use a custom script that automatically pre-fills and submits the Mailchimp signup form in the background when the user submits your Prefinery signup form. 

This results into the user being added in both the Prefinery project and the Mailchimp mailing list at once with the same email address and other supported input types. 

Here's how: 

1

In your Mailchimp account, go to Audience > Signup forms and Select Form builder

2

In the Form builder, copy your Signup form URL

3

In a new tab, paste in the link on the address bar and open it. The shortlink will then redirect to the actual link like as follows: 

https://mydomain.us10.list-manage.com/subscribe?u=043sd43b098c8a12345xx6487&id=88d10108e9
	

When you visit this link, it just shows the signup form. 

4

In your Prefinery project, go to Signup Form > JS tab and paste in the following fetch script (it's just an example, make sure to modify the tags and variables as instructed): 

<script>
     fetch("https://mydomain.us10.list-manage.com/subscribe/post?u=043sd43b098c8a12345xx6487&id=88d10108e9&EMAIL=" + prefinery_data.user.email + "&FNAME=" + prefinery_data.user.profile.first_name + "&LNAME=" + prefinery_data.user.profile.last_name, { mode: 'no-cors'});
</script>
	

Make sure to change the following for your usage: 

4.1. Replace URL https://mydomain.us10.list-manage.com/subscribe/post?u=043sd43b098c8a12345xx6487&id=88d10108e9 with yours, making sure you add /post between /subscribe and ?u= (this so that the Mailchimp form will automatically get submitted in the background). 

4.2. Replace Mailchimp field/merge tags (e.g. EMAIL, FNAME, etc.) with what your Mailchimp signup form uses (these are just defaults so yours might be different) and set the correct corresponding Prefinery script variables (e.g. prefinery_data.user.email, etc.) for those tags. 

To get the Mailchimp field tags of your form, back in your Mailchimp form builder page click on the field and you should see its field tag on the right panel as shown below: 

For the Prefinery script variables, please see the "Variables" section of our guide here

Make sure not to change anything else like the ampersands ( &) unless you're trying to create your own custom script. To add other custom functionality, we recommend consulting with your developer. 

Save changes when done. 

Still need help? How can we help? How can we help?