Skip to content

Connect Marketing Automation

⏱ 20 minutes intermediate

Form submissions on your CMS site generate leads. Without automation, those leads sit idle in a database. Connecting your CMS to a marketing automation platform lets you trigger email sequences, score leads, and nurture prospects automatically. The goal is to move visitor data from your site into your marketing workflows without manual export.

The connection works in two directions:

  1. CMS to MA β€” Form submissions, page views, and visitor profiles push to your marketing platform.
  2. MA to CMS β€” Personalized content or dynamic blocks can pull from your marketing platform’s audience segments.

This guide focuses on the outbound flow: getting CMS data into your marketing tools.

  1. Create or open a form in the CMS using the built-in Forms feature.
  2. Add fields that match your marketing platform’s contact fields (email, name, company).
  3. Publish the form on a landing page.
  4. Submit a test entry and verify it appears in Forms > Submissions.

Most marketing automation connections use webhooks or API integrations.

  1. In your marketing platform, create a new inbound webhook endpoint.
  2. Copy the webhook URL.
  3. In the CMS, navigate to Forms > Settings for your form.
  4. Add a Post-Submission Action and select Webhook.
  5. Paste the webhook URL.
  6. Map CMS form fields to the expected webhook payload fields.
  7. Save the configuration.
Webhook payload mapping
json
{
  "email": "{{Email}}",
  "firstName": "{{FirstName}}",
  "lastName": "{{LastName}}",
  "source": "cms-form",
  "formName": "{{FormName}}",
  "submittedAt": "{{Timestamp}}"
}
  1. Verify by submitting the form. Check your marketing platform for the new contact.
Custom form submission handler
csharp
using Optimizely.Forms.Core;
using Optimizely.Forms.Core.Events;

[InitializableModule]
public class MAConnectorInit : IInitializableModule
{
    public void Initialize(InitializationEngine context)
    {
        var formEvents = context.Locate.Advanced
            .GetInstance<FormsEvents>();
        formEvents.FormSubmitted += OnFormSubmitted;
    }

    private void OnFormSubmitted(object sender, FormSubmittedEventArgs e)
    {
        var email = e.SubmittedData["Email"];
        var name = e.SubmittedData["Name"];
        // Send to your MA platform API
        MarketingApiClient.CreateContact(email, name);
    }

    public void Uninitialize(InitializationEngine context) { }
}
  1. Create an initialization module that subscribes to FormSubmitted events.
  2. Extract the submitted field values from the event arguments.
  3. Call your marketing platform’s API to create or update the contact.
  4. Deploy and verify by submitting a test form entry.

Beyond form data, visitor page views provide valuable context for lead scoring.

  1. Add your marketing platform’s tracking script to the site layout template.
  2. Configure the script to capture page URLs and visitor identifiers.
  3. Verify by browsing several pages and checking the visitor’s activity log in your marketing platform.
  1. Visit your site as an anonymous visitor.
  2. Browse several pages to generate behavioral data.
  3. Submit a form with a test email address.
  4. Open your marketing platform.
  5. Search for the test contact. You should see the form submission data.
  6. Check the activity timeline. Page views should appear if tracking is configured.
IssueCauseFix
Form submission not reaching MAWebhook URL incorrectVerify the URL and test with a tool like Postman
Missing fields in MA contactField mapping mismatchAlign CMS field names with MA expected fields
Duplicate contacts createdNo deduplication ruleConfigure your MA to deduplicate by email
Tracking script not firingScript blocked by cookie consentEnsure tracking loads after consent is granted