Integrate Goal With MailChimp

This feature requires Manager user level or higher and is part of paid features.

Goal is an optional campaign feature that tracks subscriber activity on your website, and can be used to trigger  Automation workflows or to create targeted segments for new campaigns. 

This is a paid account feature, and is included with all Pay As You Go, Monthly, and High Volume Plans. In this article, you'll learn how to enable Goal for your account and how you can use Goal tracking information to engage your subscribers.

How Goal Works

MailChimp stores a web cookie in a subscriber's browser when they click from a Goal-enabled campaign to a webpage with the Goal tracking snippet installed. The cookie assigns a unique ID to the subscriber and is present for one year or until that subscriber clears the cookies from their browser. Anytime the subscriber returns to your website, the cookie is referenced to track their activity on your site even if the subscriber doesn't click from a MailChimp campaign.

If a subscriber visits your site from another browser or device without clicking through from a Goal-enabled campaign, that subscriber's activity will not be tracked by Goal.

Subscribers can enable privacy settings in their browser to restrict tracking cookies. Because we respect do-not-track privacy settings, these subscribers may show open and click activity, but will not have Goal activity.

Set Up the Goal Integration

To enable Goal and add the JavaScript tracking snippet to your website, follow these steps.

  1. Click your profile name to expand the Account Panel and choose Account.
  2. Click  Integrations.
  3. Click Goal to expand the integration options.
  4. Click the Enable button.
  5. Copy the Goal tracking code we provide and place it at the bottom of the <head> section of every page on your website you want to track. If your website uses a template, place the code snippet in the <head> of the template to add Goal tracking to all pages on your site.

After you've embedded the Goal tracking code, you can add Goal tracking to campaigns or use the Website activity Automation workflow type to segment on Goal data.

Add Goal Tracking to a Campaign

To add Goal tracking to a campaign, follow these steps.

  1. Navigate to the Setup step of the Campaign Builder.
  2. In the Tracking section, check the box for Goal tracking.

    goal tracking checkbox

  3. Continue through the Campaign Builder, and send the campaign to your list.

Goal Automation Triggers

If you have set up Goal tracking on your website, you can use subscriber Goal activity as a trigger for Automation workflows. You can trigger workflows with hits to specific URLs or JavaScript events. To add more flexibility to your triggers, wildcard characters can be used in both URLs and events. Both events and URLs must be 255 characters or less.

To create an Automation workflow based on a Goal URL, follow these steps.

  1. On the List and Workflow step, choose the workflow type Website activity.
    Website activity workflow
  2. Fill in the Workflow configuration fields and click Next.
  3. Click Goal tracking under the Tracking heading if you want to track website activity from these automated emails. Click Next.
  4. On the Trigger step, input a target URL below the Trigger workflow when the following conditions are met heading.
    Build workflow set up
    Click the Add segmentation conditions box to open more segmentation options. To send emails to subscribers who visited your target URL already, check the Send first email immediately to subscribers who meet these criteria box. Click Save to continue.
  5. Build your Automation workflow and emails as usual. Preview and test your emails and click Start Workflow to activate it.

Advanced Trigger Options

JavaScript Events

A JavaScript event is an action on your website, like when someone signs up to your list or completes an e-commerce transaction. Using JavaScript events is considered an advanced feature and is recommended for users familiar with custom coding. Contact your developer, or hire a  MailChimp Expert if you need assistance

This example code shows a JavaScript event where the text "Test Event" is a link. JavaScript events must be 255 characters or less. 

If you use this JavaScript event as a trigger for your Automation workflow, any subscriber who clicks the link will start the workflow. 


To add flexibility to uncertain situations, Goal lets you add wildcard delimiters to your trigger URLs or JavaScript events. Wildcards stand in for possible characters that could appear in your URL or JavaScript event, to trigger workflows for subscribers who navigate to different versions of a URL or JavaScript event.

  • |?| allows for single character matching in a URL or JavaScript event.
    In this example, the wildcard triggers a workflow for anyone who visits "," "," or another similar URL with one character difference. It does not trigger for URLs where the wildcard character is left blank ( 

  • |*| allows for multiple character matching in a URL or JavaScript event as well as blank-character matching.
    Use the |*| character wildcard if you want to target subscribers who visit specific sections of your site. In this example, the |*| allows blank-character matching to account for whether subscribers visit the http:// or https:// version of your website. 

Goal Segments

Segment with Goal activity to target subscribers who have completed specific actions on your site. After a subscriber clicks any Goal tracked link from a campaign or automated email, you'll be able to segment by that activity to send other targeted campaigns and automated emails. 

  • URL Segments
    To target subscribers who have navigated to certain URLs on a site, include the full URL or a portion of a URL to segment by.
    Set segmenting options URL

  • JavaScript Event Segments
    To target subscribers who have completed a Javascript event, include the name of the Javascript event in the field, like 'SignupTestEvent' in the example above.
    Set segmenting options javascript

    Wildcard delimiters cannot be used in Goal segmenting. To target subscribers that clicked wildcard links in your campaign, use the contains segmenting option and include the portion of the URL you'd like to target with your segment.

  • Goal Last Visited
    This option lets you use Goal activity to target subscribers based on when they last visited a website with embedded Goal tracking code. Goal last visited criteria

Was this article helpful?
What can we do to improve articles like this?

Technical Support