Expand my Community achievements bar.

Accessing a recipient in a typology rule

Avatar

Level 2

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?

8 Replies

Avatar

Community Advisor

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

Avatar

Level 10

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

Avatar

Community Advisor

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.

Avatar

Level 6

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:

20190515-1117-screenshot-1.jpg

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

20190515-1434-screenshot-5.jpg

Regards

Florian

Avatar

Community Advisor

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

Avatar

Level 2

Hello Florian,

Thank you for your reply.

I will propose this solution as well as the previous one (JSAPI) to our team.

Good job.

Kind regards,

Ayat