{"id":31434,"date":"2018-04-21T15:47:46","date_gmt":"2018-04-21T15:47:46","guid":{"rendered":"https:\/\/ampscript.guide\/wat\/"},"modified":"2025-02-17T14:58:59","modified_gmt":"2025-02-17T14:58:59","slug":"wat","status":"publish","type":"post","link":"https:\/\/ampscript.guide\/wat\/","title":{"rendered":"WAT"},"content":{"rendered":"<h2>WAT<\/h2>\n<p>This function returns a specific set of Web Analytics Tracking parameters and values.  Once the WAT parameters and values are returned, they can be manually appended to any URLs as needed.  By default, parameter names and values must be static values.<\/p>\n<h3>Arguments<\/h3>\n<p><code>WAT(1,2,n)<\/code><\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: center;\">Ordinal<\/th>\n<th style=\"text-align: left;\">Type<\/th>\n<th style=\"text-align: left;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: center;\">1<\/td>\n<td style=\"text-align: left;\">String<\/td>\n<td style=\"text-align: left;\">True<\/td>\n<td style=\"text-align: left;\">External key of the WAT parameter set<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">2<\/td>\n<td style=\"text-align: left;\">String<\/td>\n<td style=\"text-align: left;\">True<\/td>\n<td style=\"text-align: left;\">Value for parameter 1 in the set<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: center;\">n<\/td>\n<td style=\"text-align: left;\">String<\/td>\n<td style=\"text-align: left;\">False<\/td>\n<td style=\"text-align: left;\">Value for parameter 2 in the set (see note)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>NOTE: Additional parameter values can be appended as arguments.<\/p>\n<\/blockquote>\n<p><a href=\"https:\/\/help.salesforce.com\/s\/articleView?id=mktg.mc_overview_parameter_management.htm&#038;type=5\">Parameter Manager<\/a>, when enabled, automatically appends a set of URL parameters and values to every link at email send time. This string can include in line personalization strings and AMPscript.<\/p>\n<p>The <code>WAT<\/code> function requires the <code>SPECIAL_LINK_PARAMS<\/code> business rule.  In addition, a <em>Brand Tag<\/em> named <code>ENHANCED_WEB_ANALYTICS_TRACKING<\/code> must be enabled.  Unlike the <code>email_XtraLinkParameters<\/code> set of parameters, these analytics strings are stored with <em>key<\/em> values:<\/p>\n<pre><code>verifyParams,?verify=%%=urlencode(lowercase(trim(WATP(1))))=%%<\/code><\/pre>\n<pre><code>nameParams,?fName=%%=urlencode(WATP(1))=%%&amp;lName=%%=urlencode(WATP(2))=%%<\/code><\/pre>\n<p>At send time, WAT parameters and values are added before the automatic parameters and values from Parameter Manager.<\/p>\n<p>In this example, the WAT parameter and value is retrieved, set and appended to a login URL:<\/p>\n<h3>Example 1<\/h3>\n<pre><code>%%[\n\nvar @loginURL\n\nset @loginURL = concat(\"https:\/\/limedash.com\/login\", WAT(\"verifyParams\", \"DfkSyhtdtYRBb\"))\n\n]%%\n&lt;a href=\"%%=redirectto(@loginURL)=%%\" alias=\"Login\"&gt;Login&lt;\/a&gt;<\/code><\/pre>\n<h4>Output<\/h4>\n<pre><code>&lt;a href=\"https:\/\/limedash.com\/login?verify=DfkSyhtdtYRBb\" alias=\"Login\"&gt;Login&lt;\/a&gt;<\/code><\/pre>\n<p>To overcome for the static value limitation, the <a href=\"\/treatascontent\">TreatAsContent<\/a> function can be used to evaluate the WAT function prior to appending it to the URL:<\/p>\n<h3>Example 2<\/h3>\n<pre><code>%%[\n\nvar @firstName\nvar @lastName\nvar @wat\nvar @profileURL\n\nset @firstName = AttributeValue(\"FirstName\") \/* value from attribute or DE column in send context *\/\nset @firstName = \"Nora\" \/* or a literal value *\/\n\nset @lastName = AttributeValue(\"LastName\") \/* value from attribute or DE column in send context *\/\nset @lastName = \"Taylor\" \/* or a literal value *\/\n\nset @wat = treatascontent(concat('%%=WAT(\"nameParams\",\"', @firstName,'\",\"', @lastName,'\")=%%'))\n\nset @profileURL = concat(\"https:\/\/limedash.com\/profile\", @wat)\n\n]%%\n&lt;a href=\"%%=redirectto(@profileURL)=%%\" alias=\"Profile\"&gt;Profile&lt;\/a&gt;<\/code><\/pre>\n<h4>Output<\/h4>\n<pre><code>&lt;a href=\"https:\/\/limedash.com\/profile?fName=Nora&amp;lName=Taylor\" alias=\"Profile\"&gt;Profile&lt;\/a&gt;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>WAT This function returns a specific set of Web Analytics Tracking parameters and values. Once the WAT parameters and values are returned, they can be manually appended to any URLs as needed. By default, parameter names and values must be static values. Arguments WAT(1,2,n) Ordinal Type Required Description 1 String True External key of the [&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 - WAT<\/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\/wat\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The AMPscript Guide - WAT\" \/>\n<meta property=\"og:description\" content=\"WAT This function returns a specific set of Web Analytics Tracking parameters and values. Once the WAT parameters and values are returned, they can be manually appended to any URLs as needed. By default, parameter names and values must be static values. Arguments WAT(1,2,n) Ordinal Type Required Description 1 String True External key of the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ampscript.guide\/wat\/\" \/>\n<meta property=\"og:site_name\" content=\"The AMPscript Guide\" \/>\n<meta property=\"article:published_time\" content=\"2018-04-21T15:47:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-17T14:58:59+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\/wat\/#webpage\",\"url\":\"https:\/\/ampscript.guide\/wat\/\",\"name\":\"The AMPscript Guide - WAT\",\"isPartOf\":{\"@id\":\"https:\/\/ampscript.guide\/#website\"},\"datePublished\":\"2018-04-21T15:47:46+00:00\",\"dateModified\":\"2025-02-17T14:58:59+00:00\",\"author\":{\"@id\":\"https:\/\/ampscript.guide\/#\/schema\/person\/5335042f77731e84f9808aecef25daec\"},\"breadcrumb\":{\"@id\":\"https:\/\/ampscript.guide\/wat\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ampscript.guide\/wat\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ampscript.guide\/wat\/#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\/wat\/\",\"url\":\"https:\/\/ampscript.guide\/wat\/\",\"name\":\"WAT\"}}]},{\"@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\/31434"}],"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=31434"}],"version-history":[{"count":0,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/posts\/31434\/revisions"}],"wp:attachment":[{"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/media?parent=31434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/categories?post=31434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ampscript.guide\/wp-json\/wp\/v2\/tags?post=31434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}