All Resources

Show Mailchimp Merge Tags on Your Squeeze or Download Page

I’m using some code in a custom WordPress theme that grabs a Merge tag variable from MailChimp (like a first name or email address), and then displays this variable in a WordPress template. I’m using MailChimp here because I use it and like it for my clients but this can apply to any email marketing service. It looks like this on the front end:

Screen Shot 2014-10-07 at 11.48.13 AM

Here’s the entire workflow for the opt-in and download:

  • Someone signs up for a free download on your website and enters their email address and first name.
  • That info is passed to Mailchimp which sends an automated email containing a link to the download page. We’ll get to how to setup that email in a second.
  • The download page that they are sent to displays the user’s first name along with the download itself (Hi David, here’s your download).
  • Everyone feels warm and fuzzy inside

I think this personalization of a download page is really useful for a couple of reasons.

It’s more friendly

People like seeing/hearing their own name. It makes you feel good to be recognized and there’s no reason why you shouldn’t associate those good feelings with your snazzy download page.

It will decrease the likelihood of someone sharing the download page URL.

I haven’t tested this theory (anyone with data?) but I think it makes sense. The whole point of a download page like this is that we’ve captured an email address earlier in the process in exchange for the content, so sharing isn’t ideal. What we’re saying by using their name is, “Hi David, here’s YOUR download – not your friend’s.” It subtly creates a sense of responsibility and ownership (they know my name!).

Right, now that you know what we’re going to do, here’s how you do it.

Step 1 – Configure MailChimp

There are plenty of ways to figure out how to setup a MailChimp form (your MailChimp account, WordPress plugin, Formidable Forms, Gravity Forms) so I’ll skip that. Next we need to decide what you want to display in your theme on the download page. Let’s go with First Name.

To find the merge tag for first name, go to your MailChimp list that you’re adding signups to and click: Settings > List Fields and Merge Tags

Copy the Merge tag you want — in this case it’s *|MMERGE1|* — then go to your email template for the automated email you’re sending. Again, more info about creating emails and automation can be find in a bunch of places so I won’t cover it.

Step 2 – Create your email

Now we’re going to add that Merge tag our download/landing page link inside the body of the automated email. It will look something like this:

<a href="http://www.yourwebsitehere.com/landingpage/?firstname=*|MMERGE1|*" target="_blank">Download Your Copy</a>

This can be done for any merge tags you have available for your list, and they can be combined by using ampersands like this (but you’ll have to define any extra variables in the template code we’ll see later):

http://www.yourwebsitehere.com/landingpage/?firstname=*|MMERGE1|*&email=*|EMAIL|*

Step 3 – Add code to your download page template

Again I’m going to assume you either have a unique page template for your landing page. This code that will grab the variables from our MailChimp-generated link (the stuff after the question mark in the URL) and display them in our theme.


<?php
if (isset($_GET['firstname'])) { //we have a first name to work with
$firstname = $_GET['firstname'];
echo '<p>Hi '.$firstname.', here is your download.</p>';
} else { //there isn't a first name variable, so decide what to do
echo '<p>Here is your download.</p>';
?>

Boom, done. This is a pretty simple way to have a personalized landing page without spending a ton on third-party marketing services or a membership site.

Additional Landing Page Tips

  • Using WordPress SEO or similar, make sure to noindex and remove your download page from your sitemap
  • Sharing will still happen, it’s just a fact of putting things out there on the internet. But if you or your company adds truly adds value, it will come back around
  • Consider adding a lead capture form to your landing page in case it does get traffic from folks who haven’t opted-in yet
October 7, 2014 Marketing, WordPress Development