Sometimes you’ll find that you want to guide potential subscribers’ preference or options, just to point them in the right direction. You may have noticed this about the MailChimp hosted forms, but here’s an option to try out if you’re linking to your sign-up forms. (Warning: not for those who get queasy at the site of raw html code.)
(Edit: this method will actually only work with visible items on your form. If you’re using hidden forms, it won’t work unless you put those hidden inputs on your form via the advanced designer. Using the embedded form, you can certainly track that way.)
Basically, the hosted forms are pretty versatile in the fact that they can capture and extract query strings and then pre-fill the form based on values that you can define. This gives you the ability to put in text or pre-select certain items on your form.
So, how do you do it? The first thing you’ll need is the full URL of your sign-up form. It should look something like us1.list-manage.com/subscribe?u=XXXXX&id=YYYY where the u and id values define your unique MailChimp form. Next, you’ll need to take a look at the source code of your sign-up form just to gather a little bit of information. In particular, you’re looking for all of the input elements for your html form. Here’s a sample screenshot.
Next, take note of the “name” attributes of the inputs. These should look something like “MERGEZ” where Z is a number. Basically you need to make up “name=value” pairs and attach them to the end or your MailChimp form URL as an additional query. In the above screenshot, “MERGE0″ is the email address input and “MERGE1″ is the First Name input.
An example of a query that will work is “MERGE1=Freddie” which basically says, “Set the First Name field as ‘Freddie.’” Simple, right? Here’s the before URL and the after URL. (Keep in mind, standard URL encoding rules apply to all of this. When in doubt, just type in the text you want in a browser address bar and go to the page. Most modern browsers will auto encode those characters.)
Before link and visual:
http://mailchimp.us1.list-manage.com/subscribe?u=d7ef9398dbcac36cd9e03a31f&id=7de7e9f7d8
After link and visual:
http://mailchimp.us1.list-manage.com/subscribe?u=d7ef9398dbcac36cd9e03a31f&id=7de7e9f7d8&MERGE1=Freddie
Once you test this out and try it, it’s easy to go crazy with the options. Here’s a URL that puts in a name, pre-selects the “Second Choice” on the form, inserts a favorite website, and sets the preferred format to mobile.
Link and visual:
http://mailchimp.us1.list-manage.com/subscribe?u=d7ef9398dbcac36cd9e03a31f&id=7de7e9f7d8&MERGE1=Freddie&MERGE3=Second%20Choice&MERGE4=blog.mailchimp.com&EMAILTYPE=mobile
You may be wondering about the groups fields? Those are a bit special and so deserve some individual attention. Groups come in a few flavors: checkboxes, radio buttons, and drop-downs.
For a groups field with checkboxes, you want to think about it as an array of true and false options. You still want to maintain the “name=value” relationship described above, so in this case, the desired query looks like “group[5][1]=true” or “group[5][4]=true” (which will depend on the group you’re selecting). Here’s a quick visual.
You can then tack that onto your form URL like this. Link and visual:
http://mailchimp.us1.list-manage.com/subscribe?u=d7ef9398dbcac36cd9e03a31f&id=7de7e9f7d8&group[5][1]=true&group[5][4]=true
(Bonus Points: create enough groups on your list, then view the source of your hosted form to notice a numerical pattern.)
The versions for radio buttons and drop-downs are easy enough to set up (they behave mostly like the standard fields) and their implementations are left as an exercise to the reader. (Phrases like that are borne of too many mathematics courses.)
So, of what use is this? Setting first names and email addresses isn’t very practical. However, selecting particular options for your subscribers before hand (like preferred format or newsletter frequency or even the interest groups field) can help you guide your readers in the right direction. Sometimes having some options filled out already makes the subscriber more aware of the available options and they may go and fill out more items.
Hope that helps out. Definitely test all these out before putting them into practice.


Great tutorial!
Would there be a way to include data for a hidden field in this?
We have 2 fields we know the value for, but the user does not and should not be able to alter. So our idea is to send in those as hidden data when clicking “subscribe”, and the data would end up in 2 fields that are set as hidden in the signup form builder.
Would that work? if yes, how would the string look like?
Thanks,
Peter
Peter
you can do that without altering the url, just insert this into the form after setting up the hidden field. In my case the hidden field is MERGE5 and the value is Yes
input type=”hidden” name=”MERGE5″ id=”MERGE5″ size=”3″ value=”Yes”
this page won’t let me post code, so i took the out. just surround the above line with
Thanks for the input! At some point, there should be a sign-up location that uses that along the same lines to accomplish the goal.
I have a form related question: is it possible for me to have a contact form on my website that also captures email optins?
I mean just like an ordinary contact form that also features a checkbox like “Yes, I would like to receive the newsletter”. These optins should be sent to Mailchimps database directly. Is there a way, maybe by using Wufoo?
Great, Ben’s post “Wufoo Integration with MailChimp” just answered my question. Can’t wait to try it out!
This is really helpful.
Is there a way to dynamically populate these urls instead of having to type them all manually?
Lets say I want all my recipients to have a pre-populated FNAME, LNAME, GENDER and EMAIL in the form?
Many thanks
For the most part, it certainly sounds possible. It might take a bit of work, though. To clarify, since these subscribers are signing up, they wouldn’t have any information on the MailChimp list (so merge tags wouldn’t apply).
However, with some fancy javascript or your favorite server-side scripting language it sounds like it should be possible. All the MailChimp hosted form is doing is pulling that info from the URL, so whatever method you’re using to put that info into the URL would work. It might take a wee bit of coding experience and plenty of testing. Don’t forget about URL encoding all your strings!
Great tutorial!
I need to do something similar to Peter G. I want add a hidden field to be automatically populated with the current date. I’ll then select that date as the autoresponder trigger. But I want this hidden field to be populated whether they sign up to the MailChimp hosted form, or a form on my website. Ideally through the MailChimp widget plugin for WordPress, but I’m not sure if that’s going to be possible.
This is a workaround for a problem with importing a list from aweber, and setting up the autoresponders from scratch again (with new content). Even though the video tutorials make it look easy there is a gotcha. Which we only realized weeks after moving over to MailChimp (and following the video tutorials). Our messages have not been going to to most of the list! The videos don’t tell you how to deal with this problem.
So basically there will be all the imported list members, who should all start off at message 1, all on the same date (let’s just say the day after they were imported). Then there are the new list members who sign up through MailChimp’s form. Even though they will have a signup date, I can’t use it for the autoresponders because then I’ll have to create 2 versions of each autoresponder (and there are hundreds). That’s the solution that MailChimp support came up with, but I don’t like it. So I’m trying to come up with an alternative that’s easier and cleaner.
Your article is the first place I’ve encountered something that’s given me some hope that there is an alternative solution to the rather awkward one that support has been suggesting.
I’m thinking this is going to be,
1. send the query string for the hosted form, with the date being dynamically generated on the website
2. change the code on the embedded form to populate the hidden field with a dynamically generate date.
3. WordPress plugin – I have no idea.
Any ideas or suggestions on how to implement this on the hosted forms, embedded code and the MailChimp plugin for WordPress?
Thanks for the tutorial.
The ‘For a groups field with checkboxes’ example doesn’t appear to be working.
Was this example affected by the recent updates to group management?
Thank you.
Right you are, Tom. The groups did change up a little. The blog post should now reflect that. Thanks!!
Hi, thanks for this, can you help with one thing? When using checkboxes etc, the sign-up forms no longer differentiate between options with the field name (the id is used instead), how do we pre-fill these types of form items?
Brilliant tutorial, this sounds like it will save a lot of coding time.
I have a question: Will the same principle work using the “post” setting on embedded web form on a site? For instance the code for external signup form is (excluding domain):
/subscribe?u=a50491d53cb0 …
The embeded version is something like:
/subscribe/post?u=721f4b3f3cb530b …
So obviously these are different, is it possible to use the same principle to pre-select options on “post”?
I have a few groups and need to hide these depending on signup form so this would be a massive help if it worked!
Thanks
I just checked this out today with groups appending:
&group[2][1]=true&group[2][2]
And it seems to work!! This makes things so much easier as I can just check the master external signup form source code and add in the appropriate URL.
I did think I would have to use something like this:
http://blog.mailchimp.com/tracking-signup-pages-via-the-mailchimp-embedded-forms/
But this saves having to mess around with form inputs and have a nice, clean 3 field sign up for all websites and add whatever I want in the URL!
This was a very informative article. I have a need that is very simpilar but am using the WordPress MailChimp Widget. I am calling the page with the Widget on it with a decorated URL–http://website.com/?EMAIL=xxx@aa.com&FNAME=first&LNAME=last.
Any suggestions as to how I can prepopulate the fields in the widget to make it easier to subscribe?
Hey Andy,
Hrrm, that’s a tough one. To be fair, the post was geared more toward our hosted signup process. The WordPress widget is an entirely different beast, basically giving your a built-up way to host a form that interacts with your MailChimp account via the API. Since I’m not WordPress wizard, I’m probably the last person you want advice from about that.
Playing around with my own WP install, I don’t think this blog post will help you out in this case, though.
Now, the folks over at http://wordpress.org/tags/mailchimp?forum_id=10 might have time ideas. It’s possible someone has done it before or has a suggestion about it. My guess is that it’ll involved some either digging into the PHP (what the widget is written in), or in the way the form is designed.
Hi,
I have the same problem as Donna.
I want to migrate my subscribers from ARP to MC keeping singup date and mails sent structure.
I have imported them to MC but the date added field don’t trigger the Autorespoder and emails are not sent.
How can I pre-fill a data field with the current day?
I don’t want to have duplicates autoresponders, since I think it would be easier for MC developers to solve it.
Thanks for your help
We have an existing client’s system (a job board) that he wants to integrate with mailchimp. This page seems to answer the first issue we have – we want the mailchimp signup form to be the last page of signup process and wanted to pre populate it with info we’ve already taken during signup (eg email, name, etc).
The second part is for candidates to be able to edit their mailchimp profile. From what I’ve read on here, the only way to do that is for them to click a link |UPDATE_PROFILE| that we’d embed in their email. There isn’t a way for us to provide a link from their profile in our website direct to the edit subscription form? Is their anyway to do that (even if it involves a different integration method, eg the APIs)? Thanks Mart
You could create your own registration and profile system that syncs data over to MailChimp via our API. http://mailchimp.com/api
Quick question RE the above… Does anybody any idea how I can use this with a standard form on my wordpress site? I have a form consisting of 3 fields (Name, phone, email) and I want users to fill out this form and then on submit it loads the full mail chimp hosted form for my mailing list and fills the 3 fields they have already filled in on the site itself? Can I have the form on my site append these query strings to the URL of the mailchimp form on submit? or is there any other way to do this?
Brilliant, that was exactly what I needed to separate different types of subscription forms!
Thanks so much for this.
Can you help me, why this address will not allow me to ‘un-tick’ a field? They both get ticks even though I said one should be ‘false’.
http://oldmankit.us4.list-manage2.com/subscribe/?u=bcbf3043a2ae1a1504c613655&id=00f7965094&group75051=false&group75052=true