Apr 6, 2005

MailChimp Trick: Use MERGE tags to build opt-out links

You probably already know that you can merge data (like first name, last name, address, etc) from your database into your MailChimp email campaigns.

But did you know you can also dynamically construct opt-out URLs in MailChimp that link to a customer database hosted on another server? A lot of our users (especially programmers and IT teams) do this so that they can keep their databases on their servers, and use MailChimp simply for delivery and tracking.

You basically code an opt-out link in the footer of your email, and use our MERGE tags to insert a unique identifier (such as the recipient’s "email address" or "customerID") into the string. That link then points to an unsubscribe script on your server that handles the rest. For instance, email address is *|MERGE0|* in MailChimp, so you’d make a link that points to your unsubscribe script like:

<a href="http://www.mywebsite.com/unsubscribe.phtml?optout=*|MERGE0|*"> Take me off your list </a>