Adobe Campaign, Marketing Automation

ACC | Track dynamic links

Adobe Campaign post

Some email campaign send outs can have links dynamically rendered in the content. Such links are not visible by Adobe Campaign personalization engine and thus will not be tracked.

The good thing is that we can use a workaround to make dynamic links trackable and also on top of all workarounds Adobe itself has provided feature that solves this issue.

Dynamic links tracking workaround

As we already know Adobe Campaign only sees links that are present in the email content, that means they are not provided as variable or printed to the email in loop dynamically.

To make dynamic links works there is no other way how to make them visible for tracking then to dynamically write them to the email content before the delivery is executed. The best way how to achieve this is to use personalization block and change its content dynamically before delivery activity in the workflow.

And of course do not forget to refer that personalization block in the delivery template.

Campaign with JS script that adds links to personalization block
 var personalizationBlock= NLWS.nmsIncludeView.load(personalizationBlockId),//primary key of personalization block
     html = '';
//generate content and save it to html string variable
//...
//...
// save html to personalization block
personalizationBlock.source.html =  html;
//save it
personalizationBlock.save();

Using pre-processing instructions

Second way to achieve the same is to use Adobe’s feature called pre-processing instructions.

They only apply in the context of delivery content. It is the only way to script the URL of an email and still have it tracked 

https://experienceleague.adobe.com/

We already learnt that we can achieve the same with the workaround shown before.

Create database schema

To use pre-processing with dynamic links you will need to create database schema where all dynamic links will be saved beforehand. You can create normal database schema as you would if you create new table. After you need to reference this schema inside the delivery in personalization tab. You can save as much information you want and the reference it while displaying the dynamic links.

Adding schema with dynamic links to the personalization tab of delivery

These links are then used to provide dynamic url parameters for each recipient. Also keep in mind that all the links are same for all recipients of the delivery. Then to show each recipient links based on their preference you will need to create rendering lookup function with the adobe campaign pre-processing instructions. Also check the option generate a JavaScript table.

Pre-processing instructions

The JavaScript name will then be referenced in the pre-processing instructions in for loop

<%@ foreach object="javascriptName" item="javascriptName_item" %>

We will show on the example provided by adobe how you can create dynamic links with the for loop. First you need to have some identifier by which you will be able to match recipient link in the list of all links. The id for item to display will come in the target data to the delivery (it will be attached to the recipient and will or can be different for each one)

<%@ value object='startScript' %>
function displayLink(id)
{
  <%@ foreach object="javascriptName" item="javascriptName_item" %>
    if( id == "<%@ value object="javascriptName_item" xpath="@id" %>" ) 
    {
      <%@ value object='endScript' %>
        <a href="http://example.net?id=<%@ value object="javascriptName_item" xpath="@id" %>">Some dynamic link</a>
      <%@ value object='startScript' %>
    } 
  <%@ end @%>
}
<%@ value object='endScript' %>
 

Basically the instruction

<%@ value object="javascriptName_item" xpath="@id" %>

will insert value to the personalization script. So if the variable is string you need to wrap it with double quotes otherwise you will be getting errors in personalization in the delivery log.

"<%@ value object="javascriptName_item" xpath="@id" %>"

Display the links using for loop

<%
var dynamicLinksArray = 
  'can be array variable you can inject to the personalization block from the targeting dimension'
+ 'can be also link to another table'
for(var i=0; i<dynamicLinksArray.length; i++ ){
 displayLink(dynamicLinksArray[i])
}
%>

Pros and cons

I do not have any preference which way to add dynamic links to the delivery for me both the workaround and pre-processing instructions worked same.

WorkaroundPre-processing instructions
Easier to grasp the concept
No need to create database schema
The vendor described way
_label, _type attributes works properly
Less code written to personalization blcok

Oh hi there đź‘‹
I have a FREE e-book for you.

Sign up now to get an in-depth analysis of Adobe and Salesforce Marketing Clouds!

We don’t spam! Read our privacy policy for more info.

#email template
Marcel Szimonisz
Marcel Szimonisz
MarTech consultant As a marketing automation consultant, I specialize in solving problems, automating processes, and driving innovation in my clients' marketing platforms.

I hold certifications in Adobe Campaign v6 (3x certified) and Salesforce Marketing Cloud (5x certified).

Additionally, I serve as a community advisor for Adobe Campaign, offering expert insights and guidance.

In addition to my professional pursuits, I also enjoy exploring various programming languages, CMSs, and frameworks, further enhancing my technical expertise and staying at the forefront of industry advancements.
Take a look at our subscription offering in case you are looking for a Marketing Automation Consultant.

Leave a comment

Your email address will not be published. Required fields are marked *

Similar posts that you may find useful

Marketing Automation, Salesforce Marketing Cloud

Add reCAPTCHA to landing page form in salesforce marketing cloud

3 minutes read

Last time we implemented recaptcha for this blog that is build on WordPress CMS. You can read the article here. Today I will show you, how to implement same recaptcha from google but on Salesforce Marketing Cloud Pages. To register your cloud page, you will need to register each domain separately, visit  google recaptcha and […]

Continue reading
Adobe campaign classic hot clicks extract workflow
Adobe Campaign, Marketing Automation

How to redo hot clicks report in workflow

3 minutes read

In the world of email marketing, tracking recipient activity is essential to understanding the effectiveness of your campaigns. One valuable report that marketers often rely on is the “Hot Clicks Report,” which provides insights into recipient interactions, such as email clicks. The report is included with the Adobe Campaign Classic installation, and you can simply […]

Continue reading
Adobe Campaign Classic tips
ACC Tips & Tricks, Adobe Campaign, Marketing Automation

Troubleshooting web applications

1 minute read

When building any web application (webapp), you may have experienced a syntax error on, for example, line 200. This can be perplexing, especially when your custom JavaScript code does not even have 200 lines. Why is that? The reason for this discrepancy is that the web applications you create in the visual editor are compiled […]

Continue reading
Salesforce Marketing Cloud Tips
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

Fix HTTP post request wrong encoding

1 minute read

Recently, while working with the double opt-in process that employs an API to trigger transactional messages, I encountered an issue where Latin characters, characters with accent, were not captured correctly in the triggered send data extension. I have found that the SFMC HTTPPost uses, by default, WindowsCodePage 1252 encoding, which can cause issues with accented […]

Continue reading
SFMC consent management
Marketing Automation, Salesforce Marketing Cloud

Consent management in SFMC explained

6 minutes read

Even after a couple of years working with Salesforce Marketing Cloud, I am still somewhat lost on how the consent management works. I’ve decided to tackle all the uncertainties I’ve been avoiding since I first started. Let’s dive into this topic and resolve all doubts once and for all. As you might have noticed, there […]

Continue reading