Close (X)

Blog

Email Marketing, Business & Monkeys

NEW! Advanced Merge Tags

October 13th, 2008 | by Amanda

Merge tags allow you to personalize your emails.  One of the most basic and common uses of merge tags would be something like, “Hello, *|FNAME|*” inserted as a greeting for your email.  The tag *|FNAME|* will insert the user’s first name, making for a customized email experience.

Advanced Merge Tags

Advanced Merge Tags

In the latest MailChimp system update, we’ve added support for advanced merge tags.  These enable you to to do some very cool things, including the ability to create dynamic content.  In the Campaign Builder, when you click to edit any area of your content, you’ll see a link for the “advanced merge tag reference”.  Clicking this will bring up an information window with all the details I’m about to share.  We’ve divided this reference into categories to make it easier to use: Formatting, Dynamic Content, List Information, Sharing, and Campaign Information.

Let’s start with Formatting.  This class allows you to modify the way the content inside you various merge tags is displayed.  You can make the value displayed appear as all lower case characters using *|LOWER:YOUR_MERGE|* (where *|YOUR_MERGE|* might be something like FNAME for first name or LNAME for last name, etc).  *|TITLE:YOUR_MERGE|* will change the value of *|YOUR_MERGE|* to title-case, which means that the first letter in each word is capitalized.  This one is especially handy if you want to standardize the way names, for example, are displayed, regardless of whether someone signed up for your list using ALL CAPS or all lower-case characters.  Check out the image below for some additional advanced formatting tags.

Next, let’s take a look at the new tags for Dynamic Content.  In our opinion, this is one of the most exciting and powerful of our new advanced merge tags.  Essentially, we’ve enabled you the capability to set up an *|ELSEIF:CONDITION|*, using the protocol of basic logic statements.  Let me give you a scenario to make this a little more clear.  Let’s say you run an online store for Major League Baseball fans.  You might want to tailor your content to fans of certain teams based on the region they are from. For example:

*|IF:STATE=FL|*
Save 20% on all Marlins Window Stickers!
*|ELSEIF:STATE=GA|*
Save 15% on all Braves apparel!
*|ELSEIF:STATE=MD|*
Save 10% on all Orioles Window Stickers!
*|ELSE:|*
Save 15% on all MLB apparel this weekend only!
*|END:IF|*

In the coming weeks we will be going in to greater detail and giving you more examples, tricks and tips for using these advanced merge tags. There are a few more that I want to mention right now though. *|MC:SHARE|* will add all the social network icons that you see displayed at the bottom of this blog post. (Shameless plug: we know you are reading, now you’ve got to Digg us!)  In addition, *|DATE|* will insert the current date, and *|RSS:RECENT|* will insert the titles of your five (by default) most recent blog posts.  If you want to display a different number, all you have to do is use *|RSS:RECENTx|* where x = whatever number of posts you want to display.  Happy merging!

Quick Update: Here’s a cheatsheet of all MailChimp Merge Tags

Spread the monkey love:
  • TwitThis
  • Digg
  • Facebook
  • del.icio.us
  • Reddit
  • StumbleUpon
  • description
  • Google
  • LinkedIn
  • Ma.gnolia
  • MisterWong
  • Netvouz
  • NewsVine
  • Slashdot
  • Technorati
  • YahooMyWeb
  • BlinkList
  • Design Float
  • Mixx
  • Pownce
  • Propeller
  • Webnews.de

45 Comments

    • Jared says:

      Any way to filter down the social network icons to just the ones you want to use? There are just so many that I think it’s unusable right now.

    • alauter says:

      @Jared–

      Right now the *|MC:SHARE|* merge tag is only able to give you ALL of the social network icons. We may be able to add a way to filter them down in the future, but for now, it’s all or nothing.

    • bbrodka says:

      I am looking for a way to set a coupon expiration date when an email is sent

      I could use *|DATE|* like this

      This coupon expires 7 days after *|DATE|*

      But that requires people to do math and think

      I would like a merge tag that is calculated off the current date

      This coupon expires *|DATE:+7|*

      Which would add 7 days to the current date

    • Amanda says:

      @bbrodka–

      Your date request sounds reasonable enough, although it is not something we currently support. Because of the way the back end code is written, we would have to implement custom formatting for the *|DATE|* merge tag.

      We’re putting this request into the suggestion box, and it may be something we can implement in future system upgrades.

      • Greg Olson says:

        +1 on being able to show a future date for coupons with an expiration date. I need to do this also. Right now I am just saying “offer expires 1 month after *|DATE:M. d Y|*”. I would rather use “offer expires *|DATE:M(+1). d Y|*” or something like that.

    • Ezequiel Lancelotti says:

      I using MailChimp from Argentina and i need to set a male or female header (like Ms Betty or Mr John) to start my mails.
      Is any way to do this?

    • Ben says:

      @Ezequiel – You can only use the advanced merge tag feature if you also have a field in your database for “gender”.

      then, you could say “IF gender is MALE, then blah”

      Alternatively, you wouldn’t need to use any logic if you have a field where your users can specify Mr., Mrs., Ms, Dr., Rev., etc.

    • Ezequiel Lancelotti says:

      @Ben, thanks.
      I discover the way a few minutes after my comment, but i apreciate your answer.
      Thanks again!

    • Sean says:

      Just a heads up: if you use the DATE tage make sure you include a colon – so it should read *|DATE:|*

      Similarly for the *|ELSE:|* tag

      Lovely!

    • Johan Trip says:

      My adress get’s displayed incorrect in the footer of the email:

      Our mailing address is:

      company name
      P.O. Box
      City
      City, State, Postalcode

      It repeats the city and sets the postalcode at the wrong position. How to solve this?

    • Nima N says:

      Can the advanced merge conditional statements be nested?

      Are regular expressions supported by any chance?

      • Ben says:

        @Nima – Yes, conditional statements can be nested. Please make sure you run lots of test campaigns to make sure that it’s all working (and looking) the way you want. No, regular expressions aren’t supported. As you may have already guessed, our approach is to leave the super-advanced stuff out of “MailChimp Proper” to keep it simple on the front end. Then, we program functionality into the MailChimp API for our super advanced users. You may want to look into a way to handle all your dB manipulation and segmentation on your end, then use the API to sync recipients over for each campaign. And if you need any developers with MailChimp API experience, check out the MailChimp Experts Directory: http://www.mailchimp.com/experts/

    • Jack Cheng says:

      Hi there, I’m trying to build an rss-to-email template for a client and want to show the previous day’s posts in a grid format (there are about 12-15 posts per day). I’m using a s (3 per row) and need to insert a after every third .

      Is it possible to have some kind of counter using the merge tags?

      • Ben says:

        @Jack – I asked our programmers, and they say what you’re attempting to do is not possible right now. There might be a way to do it later, as we expand on our merge tags to work like more of a programming language (something other advanced users have been asking for).

    • Mark says:

      Will the conditionals parse correctly for HTML code? For instance, on EmailVision we set up conditionals in order to use the same email template for multiple brands.

      If our lists have a field for a specific SITE, would MailChimp process this correctly?

      *|IF:SITE=SITE1|*
      style=”color: blue; font-weight: bold;”
      *|ELSEIF:SITE=SITE2|*
      style=”color: red; font-weight: normal;”
      *|ELSE:|*
      style=”color: yellow;”
      *|END:IF|

    • Marc says:

      I have a single master list, with a custom “interests” field for segmentation. I want to allow users to optin to different interests from different areas of my site. Problem is, if they try to optin via a subscribe form, but they are already on the list, they get a plain “email address already exists” error, with no indication that they should Update their profile to add the new interest. I was wondering if these conditionals can be used to trap for that error on the SignIn form, then direct them to their update page as an option.

      I tried a test but was unsuccessful.

      Thoughts?

      • Ben says:

        Yes, I distinctly recall another user asking us for this in a different (and angrier) way. Thanks for taking the time to submit this. I’ll scrounge up the details from the last request and post it to our internal wishlist.

    • Ashish says:

      hi,

      we are using the mailchimp API. sometime soon, we want to start sending out more customized emails i.e not just making the names be variable and if/else conditions but actually, based on person’s preference and past behaviour ( of CTR, etc ), decide the content of the email i.e the logic on our end. In a certain way, we want to segment users but have a segment/bucket of 1 user each. How would we do that and the best way to do that ?

    • Neil says:

      Ashish,

      At the present time the dynamic merge fields only refer to values within a profile. If you wanted to include previous action such as subscribers who have clicked or taken some other action, then you’d need to add this information to the subscriber’s profile.

      For instance you could have a field called “recent purchase”. Then you can update your list for each relevant campaign and update the value in the “recent purchase” field. You could insert a date value or just a yes/no value depending upon how you want to filter. Then you can use the *|IF:RECENTPURCHASE|* check to determine whether or not to place in your dynamic content.

    • Stephen says:

      Is it possible to do something like *|IF:EMAIL CONTAINS ‘aol’|* blah *|END:IF|*

    • Peter Gustavsson says:

      Hi,
      I am trying to add conditional, but cannot get it to work when I preview and use “view live merge”.

      Here is the piece of logic in my email, and the preview always take the “ELSE IF” section in preview.

      *|IF:MMERGE5=Finland|*
      Get Starterguide for Finland in Finnish
      Get Starterguide for Finland in English
      Get Starterguide for Finland in Swedish (coming soon).
      *|ELSEIF:MMERGE5=Poland|*
      Get Starterguide for Poland in Polish (Not yet available)
      Get Starterguide for Poland in English
      *|ELSEIF:MMERGE5=Denmark|*
      Get Starterguide for Denmark in Danish (Not yet available)
      Get Starterguide for Denmark in English
      *|ELSE:|*
      Please get the Starter guide in your preffered language in backoffice documents section.
      *|END:IF|*

      Hopefully you can see what is is wrong, and how to fix it. My “MMERGE5″ is Country , and in the list manager I have : “Finland, Denmark, Poland”.

      Thanks,
      Peter

    • Morgan says:

      Hi,

      I wanted to display information only if a user has a certain value for multiple merge fields. Is it possible to have nested IF statements, or to use AND within one IF statement?

      I’m thinking something like:

      *|IF:MERGE_1=0|*
      *|IF:MERGE_2=0|*
      *|IF:MERGE_3=0|*
      Text to show would go here
      *|END:IF|*
      *|END:IF|*
      *|END:IF|*

      or something like this:
      *|IF:MERGE_1=0 && MERGE_2=0 && MERGE_3=0|*
      Text to show would go here
      *|END:IF|*

      All best,
      Morgan

    • Rusty Zipper says:

      The ability to target based on interests is great, but is there a condition for is not interested.

      For example,

      *|INTERESTED:Hawaiian Shirts|*
      Hawaiian Shirts Special Feature Content
      *|END:INTERESTED|*

      bunch of regular email content goes here

      *|NOTINTERESTED:Hawaiian Shirts|*
      Regular hawaiian shirt content goes here, but we didn’t want to include this if we had already included the Hawaiian Shirts Special Feature content as it would be somewhat duplicative
      *|END:NOTINTERESTED|*

      I realize you can do nested Interested Statements with ELSE’s, but it becomes too complex & the logic starts becoming hyper-nested to solve a simple problem.

      If there isn’t an ability to do Not Interested, PLEASE consider adding it.. This works great for MERGE fields.. just need the same functionality for interests.

      Thanks!

    • Stu says:

      Is it possible to use the API or advanced merge tag feature to allow for an email that displays product based on previous purchase history? I know this would be fairly customized but we’re looking at some various solutions that might allow for this sort of dynamic email marketing.

      • Ben says:

        Hi Stu, I believe it’s possible. The scenario would be that you handle all the “previous purchases, and what to recommend” stuff on your side, then pass over content to MailChimp for delivery.

        • Stu says:

          Thanks Ben. Each of our product sku’s contains a category number so could we create a merge scenario that would be something like….If purchased product, (which would be a field in the list data base) contains “product id #X, then display this image. My question really is when using dynamic content can the merge be designed so the results are based on if the list field contains as opposed to if the list field is. If that can be accomplished then this should work and we;d assign text and image based on product category. Hope that makes sense.

          Thanks for your help…

          • Ben says:

            @Stu – I don’t think the “if contains” is possible with our current merge tags. Only if-equal. That’s the kinda logic you’d need to pre-process on your end, then you could pass all appropriate fields over to MailChimp via the API.

            I could be mistaken. If so, the nerds here (apparently) monitor my comments, and always jump in to correct me when I say something wrong. Which is quite often.

        • Rusty Zipper says:

          Ben,

          I had asked Bill about something similar in chat & I think we had determined it wouldn’t be possible because this would amount to a unique email for each contact. We had thought about doing this via a unique RSS feed for each contact. We would be very interested if you could elaborate on possible approaches to this. Our only thought here was to use dynamic merge tags to pass a unique ID to a script on our web server that served up an image dynamically for the customer & pass the same unique ID to the target URL, which would then generate the recommendations page. We’d love to include more robust content in the email itself though.

          Thanks

          • Stu says:

            Thanks Ben and Rusty. I was hoping to find a solution that wouldn’t involve my IT guy. Yes Rusty, in response to your comment
            <>

            That is exactly what we’re trying to do. If we get further along I will certainly post here, thank you both for your help.

    • Max says:

      Hi,
      i’ve in my signupform something like this
      Title (with checkboxes Mr. & Mrs), then firstname & lastname.
      In german i need two different salution if is a man or a woman
      Sehr geehrter Firstname Lastname (Men)
      Sehr geehrte Firstname Lastname

      How can i relize it?
      Thanks

      Max

    • Lisa says:

      Is it possible to use these merge tags to create a customized hyperlink for each recipient? Or is there another way to track which recipients click on a hyperlink in an email?

    • Ken says:

      I’m trying to alter the “final welcome email” based on the current month. We offer a different special each month. The *|IF|* conditional doesn’t seem to play nicely with *|DATE:|*

      Here’s an example of what I’m trying to do:

      *|IF:DATE:m=10|*
      October Special
      *|ELSEIF:DATE:m=11|*
      November Special
      *|ELSEIF:DATE:m=9|*
      September Special
      *|ELSE:|*
      Generic Special
      *|END:IF|*

      All I end up getting is the “Generic Special” text regardless of how I modify the Date in the If tag.

      Any thoughts?

    • Majdi Haroun says:

      I am planning on using RSS to create campaigns. My question is how to I using merge tags pick up and display specific XML rags from my feed beyond what the cheat sheet shows. eg if my feed has a field called longdescription. How can I used that?

    • rob steevensz says:

      I would like to merge individual images, each image is the name of the receiver, can I merge those pre-generted image in any way, I have a field in the databse with the correct image filename.

      • Ben says:

        Yes. Just upload the images to your server (loading into your MailChimp image gallery might work too, but I’m not sure if the filenames get altered when you do that, so test test test). Let’s say you have photos of sales reps, like bob.jpg, mary.jpg, and rob.jpg. In your newsletters, each subscriber/customer should see a different picture of their sales rep. Your database needs a column like “sales_rep” and the names of sales reps would go there (bob, mary,rob). The merge tag for that dB column would be *|SALES_REP|*

        in your email newsletter, wherever you want the photo to show up, you’d code your image tag like this:

        img src=”http://www.example.com/images/*|SALES_REP|*.jpg

        That’s how it works in concept. It’s been years since I’ve actually tried this, and our functionality has changed a lot since then. But i’ve seen people doing it, so I know it still works. You might just have to tweak a few steps there.

    • Marco Avezzano says:

      Hi,
      is it possible to customize also the Object field of the email (putting “Good morning Mr. XXX” in the Object and not just in the content of the email)?
      Thanks,
      Marco

      • Ben says:

        Marco – Do you mean “subject” of the email? If so, then yes. But test first! If you actually meant “object” then I’m not sure what you mean.

Leave a Reply

* indicated required
http://www.mailchimp.com/nonrestrictiveocean.php