Accessing a recipient in a typology rule | Community
Skip to main content
ayats67229299
Level 2
May 15, 2019

Accessing a recipient in a typology rule

  • May 15, 2019
  • 3 replies
  • 7361 views

At the moment, we have a typology rules (type: control) which rewrites all the URL's and adds some url parameters to it. This is done in javascript

As an improvement, we wish to add a hashed customer number as a url parameter to the URL.

Therefor I need to access the recipient.cryptedAccountId but I don't know how to acces a recipient in my javascript of a typology control rule.

Can someone provide a solution on how to add the cryptedAccountId to each URL?

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

3 replies

Jonathon_wodnicki
Community Advisor
Community Advisor
May 15, 2019

Hi,

Try the documented jsapi cryptString() function on account id, add cryptedAccountId to all your personalization, or batch select cryptedAccountId's in the script (expensive).

NB there are several undocumented encryption functions so cryptString() may not match the computed col's xtk AESEncrypt() call.

Another avenue is to alter tracking calculation click formula instead of writing a control typology here, if possible for your use case.

Thanks,

-Jon

ayats67229299
Level 2
May 16, 2019

Hi Jon,

Thank you very much for this insight.

Kind regards,

Ayat

Jean-Serge_Biro
Level 10
May 15, 2019

Hi Ayats,

In addition of what Jon wodnicki​ mentions, you must also escape the result for URL compliance.

if you are in ISO8859P* charset (Latin1, etc) please use the Adobe Campaign API Javascript escapeUrl(cryptString(recipient.@id)) or escapeUrl(recipient.@cryptedId)).
http://docs.campaign.adobe.com/doc/AC/en/jsapi/f-escapeUrl.html?hl=escapeurl

If you are in utf8 environment, you must use encodeURIComponent() standard Javascript function to escape special characters.

As said by Jon, using Javascript memory intensive calculations is not ideal at all at the step of delivering, please take care and think about other solution.

Regards.
J-Serge

Jonathon_wodnicki
Community Advisor
Community Advisor
May 15, 2019

Oh I meant selecting the data in the control typology is expensive, since it's n / batch-size lookups added per delivery.

That was meant to be written as 3 options in descending order of overhead.

Level 4
May 15, 2019

Hi,

We manages to add the Recipient Id field using the formula of the Web analytics External Account. It's not a typology rule, but it works well to add any recipient field on any url.

Formula:

Demo, we land on this URL when we click on a link in the email:

Regards

Florian

Jonathon_wodnicki
Community Advisor
Community Advisor
May 15, 2019

Right, that's tracking calculation click formula plus extra analytics params.