Connect Marketing Automation
Why connect marketing automation
Section titled βWhy connect marketing automationβ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.
Understand the data flow
Section titled βUnderstand the data flowβThe connection works in two directions:
- CMS to MA β Form submissions, page views, and visitor profiles push to your marketing platform.
- 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.
Set up form data capture
Section titled βSet up form data captureβ- Create or open a form in the CMS using the built-in Forms feature.
- Add fields that match your marketing platformβs contact fields (email, name, company).
- Publish the form on a landing page.
- Submit a test entry and verify it appears in Forms > Submissions.
Configure the connector
Section titled βConfigure the connectorβMost marketing automation connections use webhooks or API integrations.
Option A: Webhook integration
Section titled βOption A: Webhook integrationβ- In your marketing platform, create a new inbound webhook endpoint.
- Copy the webhook URL.
- In the CMS, navigate to Forms > Settings for your form.
- Add a Post-Submission Action and select Webhook.
- Paste the webhook URL.
- Map CMS form fields to the expected webhook payload fields.
- Save the configuration.
Webhook payload mapping
{
"email": "{{Email}}",
"firstName": "{{FirstName}}",
"lastName": "{{LastName}}",
"source": "cms-form",
"formName": "{{FormName}}",
"submittedAt": "{{Timestamp}}"
} - Verify by submitting the form. Check your marketing platform for the new contact.
Option B: API integration (PaaS)
Section titled βOption B: API integration (PaaS)βCustom form submission handler
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) { }
} - Create an initialization module that subscribes to
FormSubmittedevents. - Extract the submitted field values from the event arguments.
- Call your marketing platformβs API to create or update the contact.
- Deploy and verify by submitting a test form entry.
Track visitor behavior
Section titled βTrack visitor behaviorβBeyond form data, visitor page views provide valuable context for lead scoring.
- Add your marketing platformβs tracking script to the site layout template.
- Configure the script to capture page URLs and visitor identifiers.
- Verify by browsing several pages and checking the visitorβs activity log in your marketing platform.
Verify end-to-end
Section titled βVerify end-to-endβ- Visit your site as an anonymous visitor.
- Browse several pages to generate behavioral data.
- Submit a form with a test email address.
- Open your marketing platform.
- Search for the test contact. You should see the form submission data.
- Check the activity timeline. Page views should appear if tracking is configured.
Common issues
Section titled βCommon issuesβ| Issue | Cause | Fix |
|---|---|---|
| Form submission not reaching MA | Webhook URL incorrect | Verify the URL and test with a tool like Postman |
| Missing fields in MA contact | Field mapping mismatch | Align CMS field names with MA expected fields |
| Duplicate contacts created | No deduplication rule | Configure your MA to deduplicate by email |
| Tracking script not firing | Script blocked by cookie consent | Ensure tracking loads after consent is granted |