{"id":31334,"date":"2018-04-21T15:47:45","date_gmt":"2018-04-21T15:47:45","guid":{"rendered":"https:\/\/ampscript.guide\/dynamic-link-tracking\/"},"modified":"2025-02-20T20:03:04","modified_gmt":"2025-02-20T20:03:04","slug":"dynamic-link-tracking","status":"publish","type":"post","link":"https:\/\/ampscript.guide\/dynamic-link-tracking\/","title":{"rendered":"Dynamic Link Tracking"},"content":{"rendered":"<h2>Dynamic Link Tracking<\/h2>\n<p>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.<\/p>\n<h3>Example<\/h3>\n<p>In this example, a &#8216;Country&#8217; value is retrieved from a &#8216;Members&#8217; Data Extension based on a matching &#8216;Subscriber Key&#8217; value. In turn, click engagement can be tracked based on a Subscriber&#8217;s country.<\/p>\n<pre><code>%%[\n\n  set @country = Lookup('Members','Country','Subscriber Key', _subscriberKey)\n\n]%%\n&lt;a href=\"https:\/\/limedash.com\" alias=\"%%=v(@country)=%%\"&gt;Offer&lt;\/a&gt;<\/code><\/pre>\n<blockquote>\n<p>NOTE: Web-Analytics Connector\/Parameter Manager does not support alias values set by AMPscript.  Any <code>linkname<\/code> 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.<\/p>\n<p>NOTE: Inline AMPscript lookup functions are not supported in alias values.<\/p>\n<p>NOTE: By default, alias attributes and values do not appear in the final HTML output.  If you&#8217;d like to see these values, you can have Salesforce Support enable the <code>SmartUrlEncoding<\/code> feature.<\/p>\n<p>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.<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8216;Country&#8217; value is retrieved from a &#8216;Members&#8217; Data Extension based on a matching &#8216;Subscriber Key&#8217; value. In turn, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v14.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The AMPscript Guide - Dynamic Link Tracking<\/title>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ampscript.guide\/dynamic-link-tracking\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The AMPscript Guide - Dynamic Link Tracking\" \/>\n<meta property=\"og:description\" content=\"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 &#8216;Country&#8217; value is retrieved from a &#8216;Members&#8217; Data Extension based on a matching &#8216;Subscriber Key&#8217; value. In turn, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ampscript.guide\/dynamic-link-tracking\/\" \/>\n<meta property=\"og:site_name\" content=\"The AMPscript Guide\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-21T15:47:45+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-20T20:03:04+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ampscript.guide\/#website\",\"url\":\"https:\/\/ampscript.guide\/\",\"name\":\"The AMPscript Guide\",\"description\":\"The Definitive Scripting Manual for Salesforce Marketing Cloud\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/ampscript.guide\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/dynamic-link-tracking\/#webpage\",\"url\":\"https:\/\/ampscript.guide\/dynamic-link-tracking\/\",\"name\":\"The AMPscript Guide - Dynamic Link Tracking\",\"isPartOf\":{\"@id\":\"https:\/\/ampscript.guide\/#website\"},\"datePublished\":\"2018-04-21T15:47:45+00:00\",\"dateModified\":\"2025-02-20T20:03:04+00:00\",\"author\":{\"@id\":\"https:\/\/ampscript.guide\/#\/schema\/person\/5335042f77731e84f9808aecef25daec\"},\"breadcrumb\":{\"@id\":\"https:\/\/ampscript.guide\/dynamic-link-tracking\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ampscript.guide\/dynamic-link-tracking\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ampscript.guide\/dynamic-link-tracking\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/\",\"url\":\"https:\/\/ampscript.guide\/\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ampscript.guide\/dynamic-link-tracking\/\",\"url\":\"https:\/\/ampscript.guide\/dynamic-link-tracking\/\",\"name\":\"Dynamic Link Tracking\"}}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/ampscript.guide\/#\/schema\/person\/5335042f77731e84f9808aecef25daec\",\"name\":\"dev\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts\/31334"}],"collection":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/comments?post=31334"}],"version-history":[{"count":0,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts\/31334\/revisions"}],"wp:attachment":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/media?parent=31334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/categories?post=31334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/tags?post=31334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}