Document toolboxDocument toolbox

Link Algorithm (Legacy)

Summary / TL:DR: This article will show you how to use the Link Algorithm shared asset for link tracking.

3 min read

In your production and sandbox instances you will find a shared asset labeled "Link Alogrithm." This shared asset stores all of the logic for promotion, order, and unsubscribe links to work. 

Note: Every email template that has either a promotion, order, or unsubscribe link must include the following shared asset. Please check with you team to see if you are using the default shared asset defined by WesTech or a customized version on your templates.

Include at the top of every template

<shared_asset> bsft_Link_Algorithm </shared_asset>

Now, lets take a look at the components of this shared asset and the purpose for each section.


The Algorithm

The link algorithm section is a snippet of code that is required to generate the appropriate link tracking parameters needed for IRIS, Opium, FunnelCake, and Unsubscribe links. It's important to not modify this code as it will adversely affect your reporting, sales, and deliverability reputation.

{% assign campaignId = {{campaign_uuid}} %} {% assign experimentId = {{experiment_uuid}} %} {% comment %} Order Link {% endcomment %} {% assign contactId = {{user_transaction.group_id}} %} {% assign shsec = "5018bbccde7b4d3ecf0b800b39e7200f" %} {% assign order_vid_string = campaignId | append: "|" | append: contactId | append: "|" | append: shsec %} {% assign order_vid = {{order_vid_string | md5_vid}} %} {% comment %} Unsub Link {% endcomment %} {% assign emailId = {{user_transaction.email_id}} %} {% assign listCode = {{user_transaction.list_code}} %} {% assign st = "SUA" %} {% assign unsub_vid_string = st | append: emailId | append: listCode %} {% assign vid_up = {{unsub_vid_string | sha256}} %} {% assign unsub_vid = {{vid_up | downcase}} %} {% assign eid = {{user_transaction.email_id | b64_enc}} %} {% assign lstcd = {{user_transaction.list_code | b64_enc}} %}

Promotion and Order Link Parameters (IRIS, IRIS+, Opium, & FunnelCake)

The promo_query_vars variable captures the needed link parameters to allow promotion and order links to work properly. 

To view an example visit the Promotion and Order Links wiki page

{% capture promo_query_vars %}?customerNumber={{contactId}}&campaignId={{campaignId}}&r=eml&experimentId={{experimentId}}&vid={{order_vid}}{% endcapture %}

Unsubscribe Link Parameters (SignupApp 2)

The unsub_query_vars variable captures the needed link parameters to allow unsubscribe links to work properly.


Defining your Unsubscribe Links

Defining your Unsubscribe links requires three functions.

First, we use CASE to look up the list_code data synced from Advantage.

Second, we use WHEN to define our Advantage list code.

Finally we use CAPTURE to define our Unsubscribe Link inside the unsub_link variable.

To view an example visit the Unsubscribe Links wiki page

Note: To define additional unsubscribe links, simply copy and paste the two lines WHEN and CAUPTURE unsub_link. Modify the list code inside of the WHEN function, then, change out your unsubscribe link in the CAPTURE function.



 

com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'html-macro' is unknown.