Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 4th edition of the Campaign Community Lens newsletter is out now!

Append a crypted string to ALL CLICKED URL in NmsTracking_ClickFormula

Avatar

Level 5

Hi,

I would like to append a string to all clicked tracked URL in NmsTracking_ClickFormula

<% if( typeof strPurlTrackingServer!="undefined" && strPurlTrackingServer.toString() ) { %><%= strPurlTrackingServer %><% } else { %><%@ include option='NmsTracking_ServerUrl' %><% } %>/r/?id=<%= type.substr(0, 1) + (message.id,<%@ value object="delivery" xpath="@idTracking" %>,<%= escapeUrl("$(urlId)") %><% if (document.mode == "forward") {   var d = message.getParameter("d")   if( d )     d = d.split(",") %>&ap_visitorId=<%=message.getParameter("visitorId") != '' ? message.getParameter("visitorId"):0 %>&ap_category=<%= d[0]?d[0]:'' %>&ap_deliveryId=<%=d[1]?parseInt(d[1],16):0%><% } %><% if( typeof proposition != "undefined" && proposition.length == undefined ) { %>&ap_oid=<%= proposition.offer.id %><% } %>&email=<%@ include view='cryptoJs' %>

where 'cryptoJs' is a personalization block where is implemented a custom encryption algorithm like this:

<%cryptUrlAES = function(){

...

return output;

}

cryptUrlAES ();

%>

The problem is that <%@ include view='cryptoJs' %> is always empty.

Anyone could tell me why and I can I solve?

NOTE: the encryption algorithm was tested in a javascript code and is working


Thanks in advance,
Salvatore

Jean-Serge Biron

inactiveforumnotifier

Amy_Wong

Woojin

clawson

jwarren

Adobe Campaign

2 Replies

Avatar

Community Advisor

Buon giorno Salvatore,

I think personalisation blocks calls are not allowed/used in such location, but only in delivery and webApp.

Please may you try to replace directly by <%cryptUrlAES() %> or <%= cryptUrlAES() %> and define your Javascript code in a library in Administration/Settings/Javascript objects node?

Regards
J-Serge

Avatar

Level 3

your variable &email=<%= cryptUrlAES() %> should be after <%= escapeUrl("$(urlId)") %>

try this

<% if( typeof strPurlTrackingServer!="undefined" && strPurlTrackingServer.toString() ) { %><%= strPurlTrackingServer %><% } else { %><%@ include option='NmsTracking_ServerUrl' %><% } %>/r/?id=<%=

type.substr(0, 1) + (message.id<0 ? (message.id+4294967296) : message.id).toString(16).toLowerCase()

%>,<%@ value object="delivery" xpath="@idTracking" %>,<%= escapeUrl("$(urlId)") %>&email=<%= cryptUrlAES() %>

<%

if (document.mode == "forward")

{

  var d = message.getParameter("d")

  if( d )

    d = d.split(",")

%>&ap_visitorId=<%=message.getParameter("visitorId") != '' ? message.getParameter("visitorId"):0 %>&ap_category=<%= d[0]?d[0]:'' %>&ap_deliveryId=<%=d[1]?parseInt(d[1],16):0%><%

} %><%

if( typeof proposition != "undefined" && proposition.length == undefined )

{ %>&ap_oid=<%= proposition.offer.id %><%

} %>