Goal is an optional campaign tracking feature available for paid accounts that lets you trigger autoresponders based on subscriber activity from your email campaigns to your website. The Goal integration can also be used to create segments of subscribers allowing you to send targeted campaigns to your subscribers based on their Goal activity. Below we walk you through enabling Goal for your account and how you can use Goal tracking info 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 that subscriber returns to your website, the cookie will be referenced to track their activity on your site without the subscriber having to click from a MailChimp campaign.

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

Goal integration setup

Goal is enabled from the Integrations page in your account. After enabling Goal, we provide a JavaScript snippet that must be placed in the <head> section of the HTML of pages on your website. Once in place, you can add Goal tracking to campaigns and set autoresponders to send to subscribers based on Goal tracking information.

  1. Click your profile name to expand the Account Panel and choose Account Settings.
  2. From the Extras menu, choose Integrations.

    Integrations option

  3. Click Goal to expand the integration options.
  4. Click the Enable button.

    Goal 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 wish 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.

    Goal JavaScript snippet

Add Goal tracking to a campaign

To add Goal tracking to a campaign, follow the steps below.

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

    Goals tracking

  3. Continue with the campaign building process, then send the campaign to your list.

Goal Autoresponder triggers

You can set up to four Goal triggers for a single autoresponder. Goal autoresponder triggers can be specific URLs or JavaScript events. Wildcard characters can be used with both URLs and JavaScript events to add more flexibility to your autoresponder triggers. Follow the steps below to create an autoresponder to send based on Goal trigger events.

  1. On the Autoresponder step, click the What event will trigger this autoresponder? drop down menu.
  2. Under the Goals events subheading, choose Subscriber browses to URL. Subscriber browses to URL
  3. Enter the URL or JavaScript event you want the autoresponder to trigger based on.
  4. Click the Add URL link if you'd like to add more URLs or JavaScript events to trigger the autoresponder. If you add multiple triggers, we'll send the autoresponder when a subscriber lands on any one of the URLs or completes a JavaScript event specified for the autoresponder. Add Goal URL

After setting your Goal triggers, proceed with the Autoresponder building process.

Advanced trigger options

JavaScript events

Using JavaScript events to trigger Autoresponders is a little more advanced than Goal's other features and will require an experienced developer to implement properly. Autoresponders that trigger from JavaScript events let you follow up with a subscriber after they complete a specific action on your site. Examples of JavaScript events are user actions such as submitting an information form or completing an ecommerce transaction on your site. The code below is one example of how a JavaScript event could look in your website's code:

<a href="#" onclick="$mcGoal.processEvent('SignupTestEvent');">Test Event</a>

Below is how the JavaScript code would look when viewed in a typical web browser:

Test Event

If this JavaScript event was used as a trigger, each subscriber who clicks the link above will receive the autoresponder.


Goal lets you add wildcard delimiters to your trigger URLs or JavaScript events. Wildcard delimiters stand in for possible characters that could be populated in your URL or JavaScript event. Wildcard delimiters make it possible to trigger autoresponders for subscribers who navigate to different versions of a URL or JavaScript event.

  • |?| allows for single character matching in a URL or JavaScript event. For example, if you wanted to trigger an autoresponder to send to any subscriber who made it to one of the possible pages that only had a single character difference, you would enter your url like this:

  • This would trigger the autoresponder to send to subscribers who landed on subdomains of mydomain.com that start with us. A |?| wildcard delimiter can not trigger an autoresponder if it's left blank. A character must be present for the |?| wildcard to trigger the autresponder.

  • |*| allows for multiple character matching in a URL or JavaScript event as well as blank character matching. Using the |*| character wildcard is useful if you want to target subscribers who visit specific sections of your site. For example:

  • would include anyone that visited either the http or https version of your site, rather than just a specific one.

Goal segments

Segmenting with Goal activity lets you target subscribers who have completed specific actions on your site. Subscribers can only be targeted if they have previously clicked a link from campaign or autoresponder with Goal tracking enabled and directs to a site where the Goal tracking code snippet is embedded.

  • URL segments Target subscribers that have navigated to certain URL's on a site. Include the full URL or a portion of a URL to segment by.

    Segment Goal URL
  • JavaScript event segments Target subscribers who have completed a Javascript event. Include the name of the Javascript event in the field. For example, if you wanted to target subscribers who completed a JavaScript event on your site named signup, type signup in the segmenting field.

    Segment Goal JavaScript event

    Wildcard delimiters can not 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 your Goal tracking script installed.

    Segment by Goal Last Visited


A Goal autoresponder will send to a subscriber only once. If the subscriber meets the autoresponder sending conditions after the first time, they are not sent another autoresponder.

Goal autoresponders only trigger for subscribers who meet the sending conditions after the autoresponder is activated and will not send to subscribers who met the sending conditions before the autoresponder was activated.

Goal trigger URLs and JavaScript events have a 255 character limit.

If you need assistance with adding the Goal JavaScript code snippet to your website, you may want to reach out to a developer or find a MailChimp expert in our Experts Directory to help you out.

Related Articles