Dynamic Link Tracking

AMPscript enables dynamic content to be included as an alias attribute in html anchor links within HTML email content. In turn, these values are available in email engagement reports.

Example

In this example, a ‘Country’ value is retrieved from a ‘Members’ Data Extension based on a matching ‘Subscriber Key’ value. In turn, click engagement can be tracked based on a Subscriber’s country.

%%[

  set @country = Lookup('Members','Country','Subscriber Key', _subscriberKey)

]%%
<a href="https://limedash.com" alias="%%=v(@country)=%%">Offer</a>

NOTE: Web-Analytics Connector/Parameter Manager does not support alias values set by AMPscript. Any linkname values that contain AMPscript will appear as URL-encoded code, not the resulting value. It is recommended just to use static text for any aliases.

NOTE: Inline AMPscript lookup functions are not supported in alias values.

NOTE: By default, alias attributes and values do not appear in the final HTML output. If you’d like to see these values, you can have Salesforce Support enable the SmartUrlEncoding feature.

NOTE: Marketing Cloud limits the number of unique resolved alias values to 100. If the number of unique alias names is greater than 100, the additional links will only be tracked by the link name, not by the alias name.