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

how can I custom tranking link in delivery

Andy123321
Level 2
Level 2

I want costom my tracking label in ACM delivery, and I see below article, but I'm not sure how can I add an extra script array of the delivery

I try to add the array ang got below pic error. how can I add the array articleList?

The solution is to:

  1. Pre-load all the possible articles in an extra script array of the delivery - articleList[] - which means there must be a finite number of possible articles.

  2. Write a JavaScript function at the beginning of the content.

    <%@ value object='startScript' %>
    function displayArticle(articleId)
    {
      <%@ foreach object="articleList" item="article" %>
        if( articleId == <% value object="article" xpath="@id" %> ) 
        {
          <%@ value object='endScript' %>
            <a href="http://nl.net?a.jsp?article=<%@ value object="article" xpath="@id" %>">article</a>
          <%@ value object='startScript' %>
        } 
      <%@ end @%>
    }
    <%@ value object='endScript' %>
  3. Display the article by calling the function.

    <%
    for(var i=0; i<recipient.rcpArticle.length; i++ )
    {
     displayArticle(recipient.rcpArticle[i].article.@id)
    }
    %>

Andy123321_0-1637157926705.pngAndy123321_1-1637157949324.png

 

1 Reply
LaurentLam
Level 6
Level 6

Not sure to understand fully the need.
On my side, I prefer to use an array in JSON and to loop directly in the delivery in order to build the HTML:
javascript is prohibited in emails, at least, for deliverability purpose