Discussions

Using Field Merge to Dynamically Display an Image

aziznana786
aziznana786 Marketing Operations AnalystCorte Madera, CaliforniaPosts: 9 Bronze Trophy
edited Apr 29, 2022 6:21AM in Eloqua

Want to make an image dynamic for each recipient based on a field merge?

A big thank you @Rob Sommers on this one! I hope this document makes it easy for others in the future. This is my first 'blog' and technical tip - a shame after 3+ years of being in Topliners!

We had a tradeshow in which a QR code was used for checking in. Our team wanted to keep the email in Eloqua and not use another tool to send the email. First thing that came to mind? ACD - but was I really going to upload 200+ QR codes and create 200+ rules for each individual in the ACD Rules? No way! Eloqua support had recommend this as well. Determined to find an easier, streamlined method I took to Topliners and @Rob Sommers had the solution!

Use Cases:

- Append your URL with a SFDC Lead or Contact ID with the field merge

- Append a random or personalized string in the URL

- Dynamically display an image based on a field value (w/Images being hosted externally)

Be sure to post your use cases below!

Steps to Success

1. Create a new Field Merge

2. Upload images to an external FTP site

3. Create an Excel sheet mapping your image file names to each customer

4. Add your field merge to the email.

5. Test!

1. Create a new Field Merge

With the field you wish to use to store your image file names, create a field merge. Check out the guide here:

2. Upload Images to an external FTP Site

Upload all of the images into a folder on your FTP site -> make note of the entire URL until that directory. For this example, we will use http://www.example.com/files/images/tradshow_qr/ - this is your Base URL

**Note: Make sure each file name is unique to each customer.

3. Create an Excel sheet mapping your image file names to each customer

The easiest way to get each file name is to keep all of the images in one directory. Use this guide to get the file names into a .txt file How to create a text file list of the contents of a folder. From there, copy the text over into an Excel file and map each file name to the right email customer.

See the attached file as an example. Once the file is ready, upload it into Eloqua and map it to the right field.

4. Add your field merge to the email

1. The first thing you want to do is place the field merge anywhere in the email - this will help us get the needed code for the field merge:

pastedImage_9.png

2. Next you want to right click the email text and hit Edit Source:

pastedImage_10.png

3. Once in the edit source, you will find the code for your field merge, it will look something like this: <span class="eloquaemail">QR_Code1</span>

pastedImage_11.png

4. Now we want to place this code into the code of your image source For this, take your base URL and append your field merge to the end - should look like this:

<img src="http://www.example.com/files/images/tradshow_qr/<span class="eloquaemail">QR_Code1</span>">

Final Step: remove the quotations around the "eloquaemail" to leave you with the code below:

<img src="http://www.example.com/files/images/tradshow_qr/<span class=eloquaemail>QR_Code1</span>">

That's it! Place the image where you need it in the email and it will look like a little square - since it's dynamically pulling it in, don't worry!

pastedImage_20.png

5. Test!

Simply hit the settings gear and hit 'Preview'. in the preview pane, choose a contact which you know should have the image and hit preview:

pastedImage_23.png

Boom there it is! and you are done! To be on the safe side and as a sanity check, randomly check a handful of contacts to make sure the image is rendering.

A similar approach of taking off the quotations can be used for simple URLs instead of an image as well.

If you have any questions please feel free to post them. Any comments or recommendations on guide would be great!

Post edited by OIT Integration User on
Tagged:

Comments

  • nathan.lichte
    nathan.lichte Westminster, COPosts: 22 Silver Medal

    The base url piece is critical since the Eloqua field merge from the contact table is only up to 100 characters.  CDO can go up to 250.

    This method can also be used on Eloqua landing pages.

  • hannahw91
    hannahw91 Senior CRM Executive Posts: 1

    AMAZING! This has jsut saved me such a head ache. Tried it and it works!

    Thanks @Aziz Nana and @Rob Sommers

  • Excellent - is it possible to do this with text formatted with HTML?

    i.e. instead of calling an image call variable HTML content blocks...

  • cdevelin
    cdevelin Marketing Technologies Consultant Posts: 2

    Hello - I'm struggling with this a bit, and hoping someone can fill in the gaps for me -

    To give a little background, I have some customer information that I want to merge to an email. They're not in our database, so we're using Excel to upload lists. I created a new field merge, which forces me to link it to something - Contacts, Accounts, Events/Event Sessions, or CDOs. My original assumption before finding this posting was that I'd need to create a CDO, which I did. So I created the field merge, tied it to my CDO, and inserted the field into the email.

    The piece that's missing for me is, once I've created the field in my Excel sheet, how do I get it to match up to something in Eloqua? When I upload my test list, I don't have any way to tie the fields in my list to the merge fields in the email -

    Thanks for any help you can give!

  • cdevelin
    cdevelin Marketing Technologies Consultant Posts: 2

    Hello - I'm struggling with this a bit, and hoping someone can fill in the gaps for me -

    To give a little background, I have some customer information that I want to merge to an email. They're not in our database, so we're using Excel to upload lists. I created a new field merge, which forces me to link it to something - Contacts, Accounts, Events/Event Sessions, or CDOs. My original assumption before finding this posting was that I'd need to create a CDO, which I did. So I created the field merge, tied it to my CDO, and inserted the field into the email.

    The piece that's missing for me is, once I've created the field in my Excel sheet, how do I get it to match up to something in Eloqua? When I upload my test list, I don't have any way to tie the fields in my list to the merge fields in the email -

    Thanks for any help you can give!

    Note - I moved my question to a new posting:

  • So I'm having a little bit of difficulty. For some reason this is not working for me. Not sure if this makes a difference but I am not merging the end of a URL string into an image source, I'm trying to merge the entire source URL into the image code. Below is the code I am using:

    <img src="<span class="eloquaemail">Thumbnail</span>">

    For some reason, after I save the email and go back in, the code turns into this:

    <img src="&lt;span class="eloquaemail"&gt;Thumbnail&lt;/span&gt;">

    Not sure if that is causing the issues but I am completely stumped! Any help would be much appreciated!

  • aziznana786
    aziznana786 Marketing Operations Analyst Corte Madera, CaliforniaPosts: 9 Bronze Trophy

    So I'm having a little bit of difficulty. For some reason this is not working for me. Not sure if this makes a difference but I am not merging the end of a URL string into an image source, I'm trying to merge the entire source URL into the image code. Below is the code I am using:

    <img src="<span class="eloquaemail">Thumbnail</span>">

    For some reason, after I save the email and go back in, the code turns into this:

    <img src="&lt;span class="eloquaemail"&gt;Thumbnail&lt;/span&gt;">

    Not sure if that is causing the issues but I am completely stumped! Any help would be much appreciated!

    I do apologize for teh late resopnse but be sure to test this:

    4. Now we want to place this code into the code of your image source For this, take your base URL and append your field merge to the end - should look like this:

    <img src="http://www.example.com/files/images/tradshow_qr/<span class="eloquaemail">QR_Code1</span>">

    Final Step: remove the quotations around the "eloquaemail" to leave you with the code below:

    <img src="http://www.example.com/files/images/tradshow_qr/<span class=eloquaemail>QR_Code1</span>">

    So you want to remove the parenthesis around eloquaemail.

  • akalinin
    akalinin Posts: 1 Blue Ribbon

    HOW TO GET AROUND THE IFRAME BLOCKING PROBLEM IN EMAILS ?

    Nearly all email service provider block Iframe in emails.

    Does anybody know how to call for a personalized dynamic rich content (html with text and images) in Eloqua ?

    Maybe somebody figured it out using this method ? @aziznana786  @Rob Sommers

    Thank you

    Anton

  • IkramR
    IkramR Posts: 11 Blue Ribbon

    Hello @aziznana786,

    In an event, we have set a confirmation process for those who registred in our event. For that we created an email that contains a confirmation button. When the person person press the button it will trigger blind form submission and redirect him to a confirmation landing page. We want that the blind form submission trigger the qr code generation and show it to us in the landing page.

    I have read your post and all the above comments, though i still don't know how to do that?

  • Mike de Wildt
    Mike de Wildt Halfweg (Amsterdam area)Posts: 42 Silver Medal

    Got it working, thanks for this nice feature

  • I must have a different version.  I add the field merge and I get this:

    <span unselectable="on" class="eloquaemail" style="-moz-user-select: all; -webkit-user-modify: read-only">Image21</span>

    Even if I remove the unselectable, style and the quotes around eloquaemail I still can't get it to work.

    Here is what the image source may look like:

    <img src="http://www.companyname.com/images/

    Any help is deeply appreciated!

    Vic

  • I must have a different version.  I add the field merge and I get this:

    <span unselectable="on" class="eloquaemail" style="-moz-user-select: all; -webkit-user-modify: read-only">Image21</span>

    Even if I remove the unselectable, style and the quotes around eloquaemail I still can't get it to work.

    Here is what the image source may look like:

    <img src="http://www.companyname.com/images/

    Any help is deeply appreciated!

    Vic

    I got it to work!

  • I got it to work!

    Vic,

    I would appreciate if you could share what you did to make it work.

    The issue I am facing is that the eloquaemail span tag is rendered as is without decoding the field merge.

    Rendering Example

    <img src="http://assets.xyz.com/images/products/<span class="eloquaemail"&gt;Item_Image_Link1&lt;/span&gt;">

    Thanks.

  • JJAFFRY
    JJAFFRY MilwaukeePosts: 14 Bronze Medal

    THIS IS THE BEST THING EVER!

  • Question- if you are using field merges to embed an image how do you know how to properly align the dynamic content within the email. We continue to receive "remove email field tag error" and will not send a test, however the dynamic content in the preview is properly sending. We need multiple rows and columns to display the content and align it properly. Any suggestions?

    Screen Shot 2018-09-18 at 7.51.00 AM.png

  • Shashwat Awasthi
    Shashwat Awasthi Mumbai IndiaPosts: 3 Red Ribbon

    I have to send live event email invite to approximately 1000 contacts. Out of those 1000 I want to capture their attendance as well when they come to my event. Plan is to have a unique QR code for all 1000 contacts that they can show to our event staff. After scanning that QR we should get their basic details like first name, last name, email address and country.

    Any insights how can I do that?

    It's really really urgent. Hoping someone's quick response to my questions.

    @3403989/ @Vic Lyman / @IkramR

    Thanks in Advance

    Shashwat