Adobe Campaign, Marketing Automation

How to Track dynamic links

How to Track dynamic links

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;

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

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="<%@ 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++ ){

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 schemaNeed to create custom database schema
This is the wayThe vendor described way
_label, _type attributes work properly
Less code written to personalization block

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 problem-solving, process automation, and driving innovation for clients' marketing platforms.

I hold certifications in Adobe Campaign v6 (3x certified) and Salesforce Marketing Cloud (5x certified), as well as 1x Salesforce Associate certified.

Moreover, I serve as a community advisor for Adobe Campaign, providing expert insights and guidance.

Beyond my professional pursuits, I explore various programming languages, CMSs, and frameworks, 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

SFMC tips and tricks
Marketing Automation, Salesforce Marketing Cloud, SFMC Tips & Tricks

Validation issues With Data Extension Columns _dat, _call, _from

less than a minute read

Data extension column names with _dat, _call, _from, _join suffix will fail to validate, due to using old style JOIN The fix is really easy you only need to wrap the column name like [test_from] and the problem with validation is history If you know more suffixes that will throw an error let me know

Continue reading
Adobe Campaign Classic Sub-workflow activity
Adobe Campaign, Marketing Automation

Sub-Workflow Activity: Best Practices

5 minutes read

The Sub-workflow activity in Adobe Campaign Classic is a very powerful tool that allows you to incorporate and execute reusable workflows within your main workflow. It enables you to modularize and streamline your workflow design by breaking down complex processes into smaller, manageable components. With the Sub-workflow activity, you can create separate workflows that handle […]

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

How to refresh data extension records

1 minute read

You might have noticed that records are not refreshed automatically, which makes sense. However, there is no refresh button. Here are some helpful tips I’ve discovered on how to refresh records within the data extension while it’s open. Email studio In email studio it is failry easy you simply navigate to another folder and return […]

Continue reading
An interactive whiteboard in an educational setting displays a query expression builder, highlighting the use of variables in a complex query. A group of engaged learners discuss the color-marked variables. The room is equipped with data analysis and programming resources, enhancing the learning atmosphere.
ACC Tips & Tricks, Adobe Campaign, Marketing Automation

Use variables in query expression builder

2 minutes read

When the time comes, you will find yourself in a situation where you would like to set up query builder condition expressions as dynamic values. We can achieve this and more with Adobe Campaign Classic. But what are those situations? For example, I had to build a reporting workflow for automated campaigns that was divided […]

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

Proof email was previewed but not received

2 minutes read

There are many possible issues, and I will try to list all those I have come across during my times when I wondered where my email is. Contact is unsubscribed If the contact you are trying to preview an email with is on one of the global unsubscribe lists, or has unsubscribed or bounced status […]

Continue reading