Add Lead Source Tracking to Mailchimp Embedded Forms

Mailchimp embedded forms can carry GA Connector attribution data into your audience, so every new contact arrives with UTM information, geolocation, referral data and Google Analytics identifiers already attached. What you need to set up depends on which GA Connector integration type your account uses.

Not sure which one you have? Start here: How to Check Which GA Connector Integration Type You’re Using.

API-based integration

There is nothing to configure on the Mailchimp side. The GA Connector script already captures the email address submitted through your form, and the attribution data is synced to your CRM a few minutes after the contact is created. Skip the rest of this article.

Cookie-based integration

Cookie-based integration writes attribution data into hidden fields on your form at the moment of submission. Mailchimp stores those values as merge fields on the contact, so you need to create the fields first, then add them to your embedded form.

Step 1: Replace the GA Connector script on your website

The standard GA Connector script fills hidden fields that match GA Connector’s own field names. Mailchimp uses merge tags instead, and those tags are capped at 10 characters, so the script below fills both naming conventions. Replace your existing GA Connector script with this version on every page.

Step 2: Decide which fields you need

Heads upA Mailchimp audience holds a maximum of 30 fields per contact, and five of those are taken by the default fields. On a Premium plan the limit is 80. GA Connector offers 36 data points, so on most plans you cannot add all of them. Pick the ones you will actually segment or report on.

A workable starting set is First Click Source, First Click Medium, First Click Campaign, Last Click Source, Last Click Medium, Last Click Campaign, Google Click Identifier, Google Analytics CID and First Click Landing Page. That covers attribution for most reporting without spending your whole field budget.

Step 3: Create the fields in Mailchimp

Click Audience, choose your audience if you have more than one, then click the horizontal three-dot icon and choose Audience fields and merge tags. For each field you want, click Create a new field and fill in the modal:

  • Enter a name for the field. This is the label, and it is yours to choose.
  • Set Data type to Text.
  • Enter the merge tag from the table below.
  • Leave the required checkbox unchecked.
  • Click Save.

NoteThe field name is yours to choose, but the merge tag has to match the table below exactly. The script looks up fields by merge tag, not by label. Mailchimp merge tags allow uppercase letters, numbers and underscores only, up to 10 characters, which is why the GA Connector tags are abbreviated.

Leave the fields visible on your signup forms. A field hidden at the audience level will not appear in the generated embed code, and the script has nothing to fill. You hide them with CSS in step 5 instead.

LabelInput IDLabelInput ID
All Traffic Sources GAC_ALLSRCLast Click CampaignGAC_LCCMP
BrowserGAC_BROWSRLast Click ChannelGAC_LCCHN
City (from IP address)GAC_CITYLast Click ContentGAC_LCCON
Country (from IP address)GAC_CNTRYLast Click Landing PageGAC_LCLND
First Click CampaignGAC_FCCMPLast Click MediumGAC_LCMED
First Click ChannelGAC_FCCHNLast Click ReferrerGAC_LCREF
First Click ContentGAC_FCCONLast Click SourceGAC_LCSRC
First Click Landing PageGAC_FCLNDLast Click TermGAC_LCTRM
First Click Medium GAC_FCMEDLast Click TimestampGAC_LCTS
First Click ReferrerGAC_FCREFLongitudeGAC_LNG
First Click SourceGAC_FCSRCLatitudeGAC_LAT
First Click TermGAC_FCTRMNumber of Website VisitsGAC_PGVIS
First Click TimestampGAC_FCTSOperating SystemGAC_OS
Google Analytics CIDGAC_GA4CIDDeviceGAC_DEVICE
Google Analytics Measurement IDGAC_GA4MIDRegionGAC_REGION
Google Analytics Session IDGAC_GA4SIDPages Visited GAC_PGLIST
Google Click IdentifierGAC_GCLIDTime Spent on Website GAC_TPASS
IP AddressGAC_IPADDRTime Zone GAC_TZ

Step 4: Add the fields to your embedded form

Click Forms, then Other forms, then Create new form and Create embedded form. Name the form, choose your audience, and click Continue to builder.

On the Form Fields tab, add the GA Connector fields you created. Click Continue, then Copy Code and paste the code onto your site.

Step 5: Hide the GA Connector fields

The generated form displays every field you added, which is not what you want for attribution data. Add this style block at the start of your embed code to hide them from visitors while leaving them in the form for the script to fill.

Check that it works

Visit a page with the form using a URL that carries UTM parameters, submit a test entry, then open that contact in your Mailchimp audience. The GA Connector merge fields should be populated with source, medium, campaign and the rest of the data you enabled.