Friday, 19 April 2024

Mailchimp Marketing Automation Connector for Optimizely Forms

The A2Z.EPiServer.MarketingAutomationIntegration.Mailchimp add-on connects Optimizely Forms directly to Mailchimp so teams can send form submissions into mailing lists without relying on embedded Mailchimp forms. It gives developers and marketers a cleaner way to manage audience capture and marketing automation inside the Optimizely editing workflow.

This add-on is especially useful when you want editors to keep using Optimizely Forms while still pushing data into Mailchimp lists and interests through the Mailchimp API.

Note: This add-on draws inspiration from a blog post by Joshua Folkerts.

Why use this connector

  • Keep using Optimizely Forms instead of switching to embedded Mailchimp forms.
  • Map form fields directly to Mailchimp audience fields.
  • Support required and optional Mailchimp interests.
  • Give editors a simpler workflow for audience capture and list mapping.

Installation

Install the package in your Optimizely CMS project with:

dotnet add package A2Z.EPiServer.MarketingAutomationIntegration.Mailchimp

Configuration

Add the Mailchimp integration in Startup.cs inside ConfigureServices:

public void ConfigureServices(IServiceCollection services)
{
    services.AddMarketingAutomationMailchimp(o =>
    {
        o.MailChimpApiKey = "ApiKey";
        o.RequiredInterests = new List<string> { "b5423646b8", "f24a1b729b" };
        o.OptionalInterests = new List<OptionalInterest>
        {
            new()
            {
                Key = "Alloy News",
                Value = "a5423146b8"
            },
            new()
            {
                Key = "Alloy Announcements",
                Value = "d24e1f719b"
            }
        };
    });
}

You can also configure the add-on in appsettings.json:

"A2Z": {
  "AddMarketingAutomationMailchimp": {
    "MailChimpApiKey": "ApiKey",
    "RequiredInterests": ["a5423146b8", "d24e1f719b"],
    "OptionalInterests": [
      {
        "Key": "Alloy News",
        "Value": "a5423146b8"
      },
      {
        "Key": "Alloy Announcements",
        "Value": "d24e1f719b"
      }
    ]
  }
}

If the same settings exist in both places, the values in appsettings.json take precedence.

Scheduled job for caching

The package includes a scheduled job called [A2Z] Mailchimp Cache Manager. Its purpose is to preload Mailchimp lists and fields so editors do not experience the initial delay that can happen when data is fetched on demand for the first time.

This scheduled job improves the editor experience by caching Mailchimp data in advance, making form setup faster and smoother.

How editors use it

Start by creating a form in Optimizely Forms. In this example, the form contains three text fields: First Name, Last Name, and Email Address.

Example Optimizely form used with the Mailchimp connector

Editors will then see a new Mappings tab inside the form container block, where they can connect the form to a Mailchimp list.

Mailchimp list selection inside the Optimizely form mapping tab

After selecting a Mailchimp list, editors can map Optimizely form fields to the corresponding Mailchimp fields.

Field mapping between Optimizely Forms and Mailchimp fields

Mailchimp requires an Email field, so that field must always be mapped correctly. In most cases, you will also map fields such as first name and last name depending on the list setup.

Working with interests

Mailchimp interests cannot be mapped like normal text fields. They are designed to work with Multiple or single choice form elements in Optimizely Forms.

Mailchimp interest configuration in the Optimizely connector

Interest values such as d24e1f719b come from Mailchimp and can be configured as either Required or Optional.

  • Required interests are sent with every form submission.
  • Optional interests are sent only when the visitor selects the related option in the form.

Optional and required Mailchimp interest field setup

Compatibility

This add-on currently supports Optimizely CMS 12. Check the package page or GitHub repository for the latest updates and version support.

When this is useful

  • When you want to keep using Optimizely Forms instead of external Mailchimp forms.
  • When marketers need form submissions pushed directly into Mailchimp audiences.
  • When editors need a simpler way to connect forms to lists and interests.
  • When performance matters and cached Mailchimp metadata improves the setup experience.

Links

Full documentation and source code:

GitHub repository

NuGet package

FAQ

Does this replace Optimizely Forms?
No. It extends Optimizely Forms by sending submissions to Mailchimp.

Do editors need to map fields manually?
Yes. Editors select the Mailchimp list and map Optimizely form fields to the matching Mailchimp fields.

Does it support Mailchimp interests?
Yes. The connector supports both required and optional interests.

April 19, 2024 →