ACC | Track dynamic links

in  Adobe Campaign, Marketing Automation
3 minutes read

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
in  Adobe Campaign, Marketing Automation

ACC | All about variables in Adobe Campaign

2 minutes read

In this article I will explain all sorts of variables you can come across when working with the tool. Also I will discuss different less known approach of storing variables. Workflow variables In adobe campaign we have way how to store variables between consecutive activities. Normally you would store variables as instance or context variables. […]

Continue reading
in  Automation studio, Salesforce Marketing Cloud

SFMC | Automation run on loop

2 minutes read

We all know very well, that automation can be scheduled the minimum-you-can-set once per an hour. This may satisfy mostly of automation we might build in our automation studio but sometimes we want to run automation again and again just as it finishes its previous run. To achieve that we will create while loop with […]

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

SFMC TIP | Google Analytics Integration 1

less than a minute read

When you integrate with Google Analytics, marketing cloud will add tags to all your links. When this happens, all dynamic links will be broken. Links that are defined programmatically as variable, field or attribute with GA integrated will look as if the tracking link also appends google analytics tags. This will make such link not […]

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

SFMC TIP | Open a case

less than a minute read

As the title says open a case every time you experience issue or some feature you used on another instance and now is gone. Why open a case? For example when you automation fails with detailed error “Error has occurred”. Simple solution is to “open a case”. Support will tell you exactly what happened. You […]

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

SFMC TIP | Data views for transactional emails

1 minute read

Data views in Salesforce Marketing Cloud are very handy, when it comes to getting data insights from various sources inside the platform. I will give you a quick start on how to get data insights for you transactional emails using data views. We will use data from _Sent, _Job, and _Subscriber view s.TriggererSendDefinitionObjectID – object […]

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

SMFC TIP | NULL value comparison in IF statement

less than a minute read

If you have field in DE that its value is not always populated for a particular row (customer) and you test field value against any value cloud page will throw an 500 – internal server error. To fix this you will need to add another AND-condition to test field value for NULL

Continue reading
in  ACC Tips & Tricks, Adobe Campaign, Marketing Automation

ACC TIP | Escalate user rights

1 minute read

Normally web apps run under the web app user (which is anonymous and has very little to zero rights by default) and for certain operations you would need to require to grant additional access, or even grant full admin. To grant full admin for web app user is not solution to go with. Instead I […]

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

SFMC TIP | Invalid links in HTML

1 minute read

When the HTML template is used (loading your own HTML code) all the links that use query parameters (?a=b) will resolve to invalid links when they redirect upon user click. This happens when web analytics UTM tags are being attached to the delivery. To resolve this issue all the links with additional query parameters has […]

Continue reading
in  Salesforce Marketing Cloud

SFMC | Link campaign to delivery send

3 minutes read

Hope we will live up to the day when the campaign information will be available in the data views but until that day comes we would need to do following, to establish such link inside Salesforce Marketing Cloud. Get campaign list To get campaign list we need to use REST API to get all campaign […]

Continue reading