I have an email which is sent using Rest API, this email receives a JSON Array, one element of which is a URL.

    "Plan Name": "ABCD",
    "URLLink": "xxxxxxxxx"
    "Plan Name": "PQRS",
    "URLLink": "yyyyyyy"

A HTML table is populated in the email using SSJS, by looping through the array and doing a write

Everything works perfectly, email renders just fine but the clicks on the URL do not get tracked because link wrapping has already occurred before the JS is processed.

What are my options to fix this issue with tracking?

2 Answers 2


I think if you wrap the URL with a RedirectTo function it will be tracked. However you will not be able to use this URL for Engagement Splits in Journey Builder, since any scripting will prevent this.

For reference:


  • If I use a Write, no matter what I do the link won't be wrapped as SSJS is processed last and any wrapping that needed to be done is already done. I was able to figure out a way to get around this issue. I will post an answer shortly
    – Santosh P
    Nov 12, 2020 at 12:58

Any updates to this question? I'm having a similar issue. The RedirectTo function does not work.

New contributor
user127380 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.