how can I custom tranking link in delivery | Community
Skip to main content
Level 2
November 17, 2021
Solved

how can I custom tranking link in delivery

  • November 17, 2021
  • 1 reply
  • 906 views

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)
    }
    %>

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by LaurentLam

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

1 reply

LaurentLam
LaurentLamAccepted solution
Level 5
November 22, 2021

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