Automatically Add Subscribers to a Group at Signup

Instead of manually adding your new subscribers to groups, you can save time by editing your signup form to automatically assign them to a preselected group. Preselected groups are available only for the embedded signup form and advanced mode, because the process requires you to edit HTML and create several different versions of the same form.

For example, if you have different sites for your German-, French-, and English-speaking customers, add a language group category to your list, with German, French, and English group names. You’ll modify your form code so new subscribers from each site will be automatically added to the right language group when they sign up. Later, you can target each group with content that’s most relevant to them.

In this article, you'll learn how to modify your form’s HTML code to automatically add subscribers to a group in your list when they sign up.

Before You Start

  • This process requires you to update HTML code in your embedded signup form and on your website. Contact your developer, or hire a MailChimp Expert if you need assistance.

Create Your Group

To get started, you’ll need to create a group in your MailChimp list with checkboxes or radio buttons.

Modify Your Form Code

Now, you’ll modify your embedded signup form code to make sure new subscribers are automatically added to the right group.

This process differs depending on whether you want to make your group visible, or keep it hidden from subscribers.

 

Add a Visible Group to your Form

If you make your group visible, it’ll be selected by default on the signup form. Subscribers will have the option to remove themselves from your group or choose a different one.
After you've created your group, follow these steps to modify your form code.

  1. Navigate to the Lists page.

  2. Click the drop-down menu for the list you want to work with and choose Signup forms.

  3. Select  Embedded forms.

    Choose either the  Classic or Naked embedded form, and copy and paste the form code into your website.

  4. Locate the <input> tag for the group you want subscribers to be added to automatically. Add the word  checked just before the closing bracket to force the form to check the box for your group. Your code should look something like this.

<ul><li><input type="checkbox" value="8" name="group[01245][8]" id="mce-group[01234]-01234-0" checked><label for="mce-group[16521]-01234-0">English site</label></li>

Repeat these steps for each page where your embedded signup form appears, and modify group code as needed.

 

Hidden Groups

If you want to hide your group, it’ll be selected by default at signup, but subscribers won’t be able to see it or deselect it. This option is helpful if you know their group assignment isn’t going to change.

After you've created your group, follow these steps to modify your form code.

  1. Navigate to the  Lists page.
  2. Click the drop-down menu for the list you want to work with and choose  Signup forms.
  3. Select  Embedded forms.
  4. Choose either the Classic or Naked embedded form, and copy and paste the form code into your website.
  5. To hide groups on your embedded form, find the <div> container with the group code, and add the following code inside the opening <div> tag.
    style="display:none"
  6. Locate the < input> tag for the group you want subscribers to be added to. Add the word checked just before the closing bracket to force the form to check the box for your hidden group. Your code should look something like this.
    <ul><li><input type="checkbox" value="8" name="group[01245][8]" id="mce-group[01234]-01234-0" checked><label for="mce-group[16521]-01234-0">English site</label></li>

Repeat these steps for each webpage where your embedded signup form appears, and modify the code as needed. Then, be sure to hide the group in the Form Builder as well so it doesn’t appear on any new forms you create.

Was this article helpful?
Anything else we can do to improve our site?

Technical Support