Lead Gen & CRM
How can we help you?
Search our help articles, video tutorials, and quickstart guides

You've got this. You've got us. Search our Knowledge Base to quickly find answers to your questions.

How to use Merge Variables to set up Dynamic Image URLs

Article: 000053955
Updated: February 13, 2025

This guide will help you understand how you can use Merge Variables to dynamically insert images into your emails.

In certain scenarios, you may want your contacts to each receive a different, unique image within an email. If you want to dynamically insert images into your email, then this guide is for you.


Article Contents

Users:
Administrators 
Company Managers  
Marketing Managers  
Sales Managers  
Salespersons  
Jr. Salespersons  

 

Step 1: Create your Merge Variables

The Dynamic URL field will accept two different kinds of merge variables. You can either create Setting Global Merge Variables, or you can create Creating Custom Fields

If you want the exact same image to appear whenever you insert the variable as an image URL–for example, if you always want your business’ logo to appear when you use {$companyLogo} — you will create the variable as a Global Merge Variable. Within the Global Merge Variable, you will need to ensure your image is hosted on either your website or within Lead Gen & CRM. Then you can copy and paste the image URL into the “Value” field for the Global Merge Variable. 



If you want each individual contact to receive a different image, you will want to create a URL Custom Field with the “Email Merge Variable” checkbox enabled. Once that custom field is created, you can upload a file with the image URLs to update that value on each of your leads.



NOTE: Both Global Merge Variables and Custom Fields have a limit of 255 characters. If your image URLs are longer than 255 characters, they will be cut off and will not properly populate in your emails.

 

Step 2: Copy the Merge Variable

If using a Global Merge Variable, please note you will need to copy/paste the merge variable that you created above and put brackets with a $ symbol — ex. {$companyLogo} — into the Dynamic URL box, as mentioned in Step 3.

If you are using a Custom Field Merge Variable, you will need to collect the ID by first inserting the merge variable into a text box. To do this, you will need to:

  1. Open the email editor. 
  2. Begin editing a text box. 
  3. Click “Merge Variables” on the toolbar. 
  4. Search for and select the name of your Custom Field Merge Variable.
  5. Select “Next.”
  6. This will insert a merge variable that should look something like this:

    {$custom_field_name_UniqueFieldID}
    1. In my example above, because we named the field “Contact Image Merge Variable” the merge field became. 

      {$contact_image_merge_variable_678aa07311300}

  7. Copy the text from step 6.

 

Step 3: Insert an Image and Complete Set-up of the Dynamic Image

Now that you have copied the Merge Variable you will use, we can set up the Dynamic Image.

  1. Insert a new Image block, or you can use a pre-existing image block within your email.



  2. Insert a Placeholder image. This image will appear if a lead does not have a URL listed in the Custom Field Merge Variable.



  3. On the right sidebar, click the toggle “Dynamic Image” to enable Dynamic Image. 



  4. Paste in the Merge Variable–either for your Global Merge Variable or your Custom Field Merge Variable — into the Dynamic URL box. 

    Custom Field Merge Variable ExampleGlobal Merge Variable Example


NOTE: The size of the dynamic image will be set based on the sample one, so use a sample image of the same size. If your dynamic image is not the same size as the placeholder image, your readers may receive images that are smaller or larger than intended or become otherwise distorted.

 

Step 4: Test the Dynamic Image

After setting up your Dynamic Image, it is important that you send a few Preview emails to test and ensure that the correct Dynamic Image is populating.

You can send a Preview Email by following the Sending Preview Emails. If using a Custom Field URL, When sending a Preview Email you will need to ensure you select an example Contact who has data in that field. If you select a Contact for whom that field is blank, the default image will appear in both the Preview and the Live email.


Did this article answer your question?


Constant Contact Logo

Copyright © 2025 · All Rights Reserved · Constant Contact · Privacy Center