{"id":7,"date":"2017-03-02T16:36:47","date_gmt":"2017-03-02T16:36:47","guid":{"rendered":"https:\/\/gaconnector.com\/blog\/?p=7"},"modified":"2022-10-03T09:09:55","modified_gmt":"2022-10-03T09:09:55","slug":"tracking-utm-parameters-in-salesforce-web-to-lead-forms","status":"publish","type":"post","link":"https:\/\/gaconnector.com\/blog\/tracking-utm-parameters-in-salesforce-web-to-lead-forms\/","title":{"rendered":"Tracking UTM parameters in Salesforce Web-to-Lead Forms"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-88 size-medium\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/UTM-Parameters-300x251.png\" alt=\"\" width=\"300\" height=\"251\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/UTM-Parameters-300x251.png 300w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/UTM-Parameters-768x644.png 768w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/UTM-Parameters-788x661.png 788w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/UTM-Parameters.png 940w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>This guide shows you how to track UTM parameters in Salesforce Web-to-Lead forms.<\/p>\n<p>Salesforce Web-to-Lead forms are great at creating leads in Salesforce\u00a0for each submission. But they don&#8217;t tell you where your leads come from.<\/p>\n<ul>\n<li>What websites referred them?<\/li>\n<li>Which Adwords keyword brought them to your site?<\/li>\n<li>Which Facebook ad campaign converted them?<\/li>\n<\/ul>\n<h2>Overview of tracking UTM parameters in Salesforce Web-to-Lead forms<\/h2>\n<p>In this article we&#8217;re going to explain how you can <span style=\"font-weight: 400;\">track UTM parameters in Salesforce<\/span> and have a section like this for\u00a0each of your Leads:<\/p>\n<div id=\"attachment_15\" style=\"width: 1323px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-15\" class=\"wp-image-15 size-full\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/vistorinfo.png\" alt=\"Example of tracking UTM parameters in Salesforce Web-to-Lead forms\" width=\"1313\" height=\"117\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/vistorinfo.png 1313w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/vistorinfo-300x27.png 300w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/vistorinfo-768x68.png 768w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/vistorinfo-1024x91.png 1024w\" sizes=\"(max-width: 1313px) 100vw, 1313px\" \/><p id=\"caption-attachment-15\" class=\"wp-caption-text\">Example of tracking UTM parameters in Salesforce Web-to-Lead forms<\/p><\/div>\n<p>You&#8217;ll also be able to build Salesforce dashboards with UTM information.<br \/>\nAs a result, you&#8217;ll see which campaigns generated the most sales:<\/p>\n<div id=\"attachment_16\" style=\"width: 968px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-16\" class=\"wp-image-16 size-full\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/adwords-dashboard.png\" alt=\"Salesforce report breaking out the number of qualified leads by Adwords campaign\" width=\"958\" height=\"762\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/adwords-dashboard.png 958w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/adwords-dashboard-300x239.png 300w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/adwords-dashboard-768x611.png 768w\" sizes=\"(max-width: 958px) 100vw, 958px\" \/><p id=\"caption-attachment-16\" class=\"wp-caption-text\">Salesforce report breaking out the number of qualified leads by Adwords campaign<\/p><\/div>\n<p>Let&#8217;s say this is your Web-to-Lead form:<\/p>\n<pre class=\"toolbar:2 lang:xhtml decode:true\">&lt;form action=\"https:\/\/www.salesforce.com\/servlet\/servlet.WebToLead?encoding=UTF-8\" method=\"POST\"&gt;\r\n\r\n&lt;input type=hidden name=\"oid\" value=\"00D58000000Kwkv\"&gt;\r\n&lt;input type=hidden name=\"retURL\" value=\"http:\/\/gg.com\"&gt;\r\n\r\n&lt;label for=\"first_name\"&gt;First Name&lt;\/label&gt;&lt;input  id=\"first_name\" maxlength=\"40\" name=\"first_name\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n&lt;label for=\"last_name\"&gt;Last Name&lt;\/label&gt;&lt;input  id=\"last_name\" maxlength=\"80\" name=\"last_name\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n&lt;label for=\"email\"&gt;Email&lt;\/label&gt;&lt;input  id=\"email\" maxlength=\"80\" name=\"email\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n&lt;label for=\"company\"&gt;Company&lt;\/label&gt;&lt;input  id=\"company\" maxlength=\"40\" name=\"company\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n&lt;label for=\"city\"&gt;City&lt;\/label&gt;&lt;input  id=\"city\" maxlength=\"40\" name=\"city\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n&lt;label for=\"state\"&gt;State\/Province&lt;\/label&gt;&lt;input  id=\"state\" maxlength=\"20\" name=\"state\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n\r\n&lt;input type=\"submit\" name=\"submit\"&gt;\r\n\r\n&lt;\/form&gt;\r\n<\/pre>\n<p>This is just an example &#8211; yours will look differently.<\/p>\n<p>To bring UTM fields to Salesforce, you need to do three things:<\/p>\n<ol>\n<li>Add new fields to Salesforce that will store these UTM fields.<\/li>\n<li>Add these fields to your Web-to-Lead forms (and make them hidden).<\/li>\n<li>Add some JavaScript code to your page. This code will grab the UTM parameters and put them in the hidden fields.<\/li>\n<\/ol>\n<h2>Step 1 &#8211; Add new fields to Salesforce<\/h2>\n<p>First, you need to add five new custom fields to Salesforce: UTM Source, UTM Medium, UTM Term, UTM Campaign, UTM Content.<\/p>\n<p>The JavaScript code\u00a0in step 3 will fill in these fields with the appropriate values.<\/p>\n<p>To create these fields, <span style=\"font-weight: 400;\">go to Salesforce and click <\/span><b>Setup<\/b><span style=\"font-weight: 400;\">. This will open a search field. Search for the word &#8220;Lead&#8221; and select <\/span><b>Fields <\/b><span style=\"font-weight: 400;\">from the results.<\/span><\/p>\n<div id=\"attachment_23\" style=\"width: 245px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-23\" class=\"wp-image-23 size-medium\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/lead-fields-sf-235x300.png\" alt=\"Salesforce Lead fields search screenshot\" width=\"235\" height=\"300\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/lead-fields-sf-235x300.png 235w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/lead-fields-sf.png 560w\" sizes=\"(max-width: 235px) 100vw, 235px\" \/><p id=\"caption-attachment-23\" class=\"wp-caption-text\">Salesforce Lead fields search screenshot<\/p><\/div>\n<p>Then scroll down to <strong>Lead Custom Fields &amp; Relationships<\/strong>\u00a0and click <strong>New<\/strong>:<\/p>\n<div id=\"attachment_24\" style=\"width: 1026px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-24\" class=\"wp-image-24 size-full\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/create-new-lead-fields.png\" alt=\"Custom Lead fields in Salesforce\" width=\"1016\" height=\"350\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/create-new-lead-fields.png 1016w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/create-new-lead-fields-300x103.png 300w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/create-new-lead-fields-768x265.png 768w\" sizes=\"(max-width: 1016px) 100vw, 1016px\" \/><p id=\"caption-attachment-24\" class=\"wp-caption-text\">Custom Lead fields in Salesforce<\/p><\/div>\n<p>Choose field type <strong>Text<\/strong>:<\/p>\n<div id=\"attachment_26\" style=\"width: 2652px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-26\" class=\"wp-image-26 size-full\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/3c5b52a0f96b24a48b3ffb83b8f26f4f.png\" alt=\"Salesforce - Choose new custom field type\" width=\"2642\" height=\"516\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/3c5b52a0f96b24a48b3ffb83b8f26f4f.png 2642w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/3c5b52a0f96b24a48b3ffb83b8f26f4f-300x59.png 300w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/3c5b52a0f96b24a48b3ffb83b8f26f4f-768x150.png 768w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/3c5b52a0f96b24a48b3ffb83b8f26f4f-1024x200.png 1024w\" sizes=\"(max-width: 2642px) 100vw, 2642px\" \/><p id=\"caption-attachment-26\" class=\"wp-caption-text\">Salesforce &#8211; Choose new custom field type<\/p><\/div>\n<p>Set <strong>Field label<\/strong>\u00a0to \u201cUTM Source\u201d, and Length to 255 (Salesforce fills in Field Name for you):<\/p>\n<div id=\"attachment_27\" style=\"width: 660px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-27\" class=\"wp-image-27 size-full\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/cc4b71b489c32f4e5dd9eaed29f06427.png\" alt=\"Set UTM source fields parameters in Salesforce\" width=\"650\" height=\"320\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/cc4b71b489c32f4e5dd9eaed29f06427.png 650w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/cc4b71b489c32f4e5dd9eaed29f06427-300x148.png 300w\" sizes=\"(max-width: 650px) 100vw, 650px\" \/><p id=\"caption-attachment-27\" class=\"wp-caption-text\">Set UTM source fields parameters in Salesforce<\/p><\/div>\n<p>Click <strong>Next<\/strong>, and then <strong>Save &amp; New<\/strong>.<\/p>\n<p><span style=\"font-weight: 400;\">Repeat this process four more times, creating the following fields<\/span>:<\/p>\n<ul>\n<li>UTM Medium<\/li>\n<li>UTM Term<\/li>\n<li>UTM Campaign<\/li>\n<li>UTM Content<\/li>\n<\/ul>\n<p>If you also want to know the source\/medium\/term\/etc of each opportunity or account, do the following:<\/p>\n<ol>\n<li>Create the same fields for the Opportunity and\/or Account object. You can do\u00a0this in Setup -&gt; Opportunities &#8211; Fields and Setup &#8211; Accounts &#8211; Fields.<\/li>\n<li>Go to Setup &#8211; Lead &#8211; Fields again, and click the button <strong>Map Lead Fields<\/strong>:<\/li>\n<\/ol>\n<div id=\"attachment_29\" style=\"width: 648px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-29\" class=\"wp-image-29 size-full\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/c2ed25a8774efcb8b85e9597d66eda9d.png\" alt=\"Salesforce - Map UTM fields from Lead to other objects\" width=\"638\" height=\"246\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/c2ed25a8774efcb8b85e9597d66eda9d.png 638w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/c2ed25a8774efcb8b85e9597d66eda9d-300x116.png 300w\" sizes=\"(max-width: 638px) 100vw, 638px\" \/><p id=\"caption-attachment-29\" class=\"wp-caption-text\">Salesforce &#8211; Map UTM fields from Lead to other objects<\/p><\/div>\n<p>On this page, you will be able to map the Lead fields to the corresponding Account\/Opportunity fields. <span style=\"font-weight: 400;\">This will add the UTM fields to the Account and\/or Opportunity objects.<\/span><\/p>\n<h2>Step 2\u00a0&#8211; Add new\u00a0fields to the forms<\/h2>\n<p>In\u00a0step 1, you created custom fields to store UTM parameters in Salesforce. Now we&#8217;re going to add the same fields to your Web-to-Lead forms.<\/p>\n<h4>Generate the code for new fields in Salesforce<\/h4>\n<p>To do this, go to Salesforce &#8211; Setup &#8211; Web-to-Lead, and click &#8220;Create Web-to-Lead Form&#8221;:<\/p>\n<div id=\"attachment_33\" style=\"width: 442px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-33\" class=\"wp-image-33 size-full\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/784fa20c62d8c11d7c3b6260b8c00b51.png\" alt=\"Salesforce Web-to-lead form create button\" width=\"432\" height=\"204\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/784fa20c62d8c11d7c3b6260b8c00b51.png 432w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/784fa20c62d8c11d7c3b6260b8c00b51-300x142.png 300w\" sizes=\"(max-width: 432px) 100vw, 432px\" \/><p id=\"caption-attachment-33\" class=\"wp-caption-text\">Salesforce Web-to-lead form create button<\/p><\/div>\n<p><span data-offset-key=\"63nda-0-2\">Find the UTM fields you\u00a0<\/span><span class=\"qualifier\"><span data-offset-key=\"63nda-1-0\">just<\/span><\/span><span data-offset-key=\"63nda-2-0\"> created in the \u201cAvailable fields\u201d section. Then, move them to \u201cSelected Fields\u201d using the arrow buttons between sections.<\/span><\/p>\n<p>Click \u201cGenerate\u201d and Salesforce will create a new Web-to-Lead form for you:<\/p>\n<div id=\"attachment_34\" style=\"width: 1674px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-34\" class=\"wp-image-34 size-full\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/968b3a4a5420b8920f2c56b77d604602.png\" alt=\"Sample Salesforce Web-to-Lead form\" width=\"1664\" height=\"710\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/968b3a4a5420b8920f2c56b77d604602.png 1664w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/968b3a4a5420b8920f2c56b77d604602-300x128.png 300w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/968b3a4a5420b8920f2c56b77d604602-768x328.png 768w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/968b3a4a5420b8920f2c56b77d604602-1024x437.png 1024w\" sizes=\"(max-width: 1664px) 100vw, 1664px\" \/><p id=\"caption-attachment-34\" class=\"wp-caption-text\">Sample Salesforce Web-to-Lead form<\/p><\/div>\n<p>Don&#8217;t worry, you don&#8217;t need to replace your existing forms with this new form.<\/p>\n<div class=\"\" data-block=\"true\" data-editor=\"4amm6\" data-offset-key=\"5ub8c-0-0\">\n<div class=\"public-DraftStyleDefault-block public-DraftStyleDefault-ltr\" data-offset-key=\"5ub8c-0-0\"><span data-offset-key=\"5ub8c-2-2\">You <\/span><span class=\"qualifier\"><span data-offset-key=\"5ub8c-3-0\">just<\/span><\/span><span data-offset-key=\"5ub8c-4-0\"> need to:<\/span><\/div>\n<\/div>\n<div class=\"\" data-block=\"true\" data-editor=\"4amm6\" data-offset-key=\"2t4f0-0-0\">\n<div class=\"public-DraftStyleDefault-block public-DraftStyleDefault-ltr\" data-offset-key=\"2t4f0-0-0\"><span data-offset-key=\"2t4f0-0-0\">a) extract the UTM fields from this new form, and<\/span><\/div>\n<\/div>\n<div class=\"\" data-block=\"true\" data-editor=\"4amm6\" data-offset-key=\"6ghso-0-0\">\n<div class=\"public-DraftStyleDefault-block public-DraftStyleDefault-ltr\" data-offset-key=\"6ghso-0-0\"><span data-offset-key=\"6ghso-0-0\">b) put them inside the existing Web-to-lead forms on your website.<\/span><\/div>\n<\/div>\n<p><span style=\"font-weight: 400;\">In the form just generated, you should see the following block of code:<\/span><\/p>\n<pre class=\"toolbar:2 lang:default decode:true\">UTM Source:&lt;input  id=\"00N5800000Bew3F\" maxlength=\"255\" name=\"00N5800000Bew3F\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;<\/pre>\n<h4><strong>Put the code\u00a0for the new fields in your form(s)<\/strong><\/h4>\n<p>Take the input name (e.g. <em>00N5800000Bew3F<\/em>) and <span style=\"font-weight: 400;\">add it to <\/span> this template:<\/p>\n<pre class=\"lang:default decode:true\">&lt;input id=\"utm_source\" name=\"00N5800000Bew3F\" type=\"hidden\" \/&gt;<\/pre>\n<p>In this example, the input name is <em>00N5800000Bew3F<\/em>, but in your form it will be different.<\/p>\n<p>&nbsp;<\/p>\n<p>Repeat this process for all five fields, and as a result.\u00a0<span style=\"font-weight: 400;\">Your end result should be a<\/span> block of code like this:<\/p>\n<pre class=\"lang:default decode:true\">&lt;input id=\"utm_source\" name=\"00N5800000Bew3F\" type=\"hidden\" \/&gt;\r\n&lt;input id=\"utm_medium\" name=\"00N5800000Bew3G\" type=\"hidden\" \/&gt;\r\n&lt;input id=\"utm_campaign\" name=\"00N5800000Bew3H\" type=\"hidden\" \/&gt;\r\n&lt;input id=\"utm_term\" name=\"00N5800000Bew3I\" type=\"hidden\" \/&gt;\r\n&lt;input id=\"utm_content\" name=\"00N5800000Bew3J\" type=\"hidden\" \/&gt;<\/pre>\n<p>In this example, the input name is 00N5800000Bew3F, but in your form, it will be different.<\/p>\n<p>&nbsp;<\/p>\n<p>Then put this<span style=\"font-weight: 400;\">\u00a0block of code in<\/span> your Web-to-Lead form, just above the closing &lt;\/form&gt; tag:<\/p>\n<pre class=\"toolbar:2 lang:default decode:true \">&lt;form action=\"https:\/\/www.salesforce.com\/servlet\/servlet.WebToLead?encoding=UTF-8\" method=\"POST\"&gt;\r\n\r\n&lt;input type=hidden name=\"oid\" value=\"00D58000000Kwkv\"&gt;\r\n&lt;input type=hidden name=\"retURL\" value=\"http:\/\/gg.com\"&gt;\r\n\r\n&lt;label for=\"first_name\"&gt;First Name&lt;\/label&gt;&lt;input  id=\"first_name\" maxlength=\"40\" name=\"first_name\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n&lt;label for=\"last_name\"&gt;Last Name&lt;\/label&gt;&lt;input  id=\"last_name\" maxlength=\"80\" name=\"last_name\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n&lt;label for=\"email\"&gt;Email&lt;\/label&gt;&lt;input  id=\"email\" maxlength=\"80\" name=\"email\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n&lt;label for=\"company\"&gt;Company&lt;\/label&gt;&lt;input  id=\"company\" maxlength=\"40\" name=\"company\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n&lt;label for=\"city\"&gt;City&lt;\/label&gt;&lt;input  id=\"city\" maxlength=\"40\" name=\"city\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n&lt;label for=\"state\"&gt;State\/Province&lt;\/label&gt;&lt;input  id=\"state\" maxlength=\"20\" name=\"state\" size=\"20\" type=\"text\" \/&gt;&lt;br&gt;\r\n\r\n&lt;!-- NEW FIELDS BEGIN --&gt;\r\n&lt;input id=\"utm_source\" name=\"00N5800000Bew3F\" type=\"hidden\" \/&gt;\r\n&lt;input id=\"utm_medium\" name=\"00N5800000Bew3G\" type=\"hidden\" \/&gt;\r\n&lt;input id=\"utm_campaign\" name=\"00N5800000Bew3H\" type=\"hidden\" \/&gt;\r\n&lt;input id=\"utm_term\" name=\"00N5800000Bew3I\" type=\"hidden\" \/&gt;\r\n&lt;input id=\"utm_content\" name=\"00N5800000Bew3J\" type=\"hidden\" \/&gt;\r\n&lt;!-- NEW FIELDS END --&gt;\r\n\r\n&lt;input type=\"submit\" name=\"submit\"&gt;\r\n\r\n&lt;\/form&gt;\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Congratulations! You have completed the most time-consuming steps, 1 &amp; 2. Only one more step to go!<\/p>\n<p><span style=\"font-weight: 400;\">At this point<\/span>, you already have UTM fields\u00a0in both Salesforce and your forms.<\/p>\n<p><span style=\"font-weight: 400;\">Plus, you don\u2019t need to worry about synchronizing these fields because it happens automatically.<\/span><br \/>\nThere&#8217;s just one missing piece. You need to insert the code that will populate these fields with actual UTM values.<\/p>\n<h2>Step 3\u00a0&#8211;\u00a0Populate hidden fields with values (using JavaScript)<\/h2>\n<p>As a final step, put this JavaScript code somewhere on your page:<\/p>\n<pre class=\"toolbar:2 lang:xhtml decode:true \">&lt;script type=\"text\/javascript\"&gt;\r\nfunction parseGET(param) {\r\n    var searchStr = document.location.search;\r\n    try {\r\n        var match = searchStr.match('[?&amp;]' + param + '=([^&amp;]+)');\r\n        if (match) {\r\n            var result = match[1];\r\n            result = result.replace(\/\\+\/g, '%20');\r\n            result = decodeURIComponent(result);\r\n            return result;\r\n        } else {\r\n            return '';\r\n        }\r\n    } catch (e) {\r\n        return '';\r\n    }\r\n}\r\n\r\ndocument.getElementById('utm_source').value = parseGET('utm_source');\r\ndocument.getElementById('utm_medium').value = parseGET('utm_medium');\r\ndocument.getElementById('utm_campaign').value = parseGET('utm_campaign');\r\ndocument.getElementById('utm_term').value = parseGET('utm_term');\r\ndocument.getElementById('utm_content').value = parseGET('utm_content');\r\n&lt;\/script&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p>You can put it inside a Google Tag Manager tag if you&#8217;d like.<\/p>\n<p>Congratulations! You have completed the most time-consuming steps, 1 &amp; 2. Only one more step to go!<br \/>\nBy now, you already have UTM fields both in Salesforce and your forms.<br \/>\nPlus, these fields get automatically synchronized. So you don&#8217;t need to worry about that.<br \/>\nThere&#8217;s just one missing piece left. You need to insert the code that will populate these fields with actual UTM values.<\/p>\n<h2>Bonus Step 4<\/h2>\n<p>If you&#8217;ve\u00a0followed this guide and <span style=\"font-weight: 400;\">and implemented<\/span>, you&#8217;re already ahead of most marketers out there.<\/p>\n<p>If you want to\u00a0go one step further, you can implement <a href=\"https:\/\/gaconnector.com\/salesforce-google-analytics\">GA Connector <\/a>&#8211; a tool that allows you\u00a0to <span style=\"font-weight: 400;\">find out <\/span> even more about your clients.<\/p>\n<p>You see, tracking <span style=\"font-weight: 400;\">only<\/span> UTM parameters has its limitations:<\/p>\n<ul>\n<li>It doesn&#8217;t work <span style=\"font-weight: 400;\">when users leave your page and then return from a bookmark or by typing your URL<\/span>. <span style=\"font-weight: 400;\">UTM information is lost for these leads<\/span> (unless you use a tool like GA Connector).<\/li>\n<li><span style=\"font-weight: 400;\">It also doesn\u2019t work if you have a multi-page website<\/span>: if\u00a0a\u00a0user lands on one of your pages, but the actual form submission happens on another page, the UTM information\u00a0is\u00a0lost.<\/li>\n<li>This approach only tells you which channel\u00a0<strong>converted<\/strong>\u00a0the lead. But sometimes it takes more than one visit to seal the deal\u00a0<span style=\"font-weight: 400;\">and thus there could be more than one channel<\/span>. You user could have found you through\u00a0Google but came back through Facebook remarketing. Does it make sense to attribute the conversion only to remarketing?<\/li>\n<li>This approach doesn&#8217;t\u00a0let you\u00a0track organic Google searches. You can&#8217;t put UTM parameters there. Same with referrals that you don&#8217;t control (not everyone wants to put UTM parameters in their links).<\/li>\n<li>This method doesn&#8217;t give you other important information about your customers: which device\/browser they\u00a0are using, their referrer, \u00a0where are they located etc. These are all important clues that can be valuable during the\u00a0sales process and for analytics.<\/li>\n<\/ul>\n<p>GA Connector solves all those issues. It allows you\u00a0to\u00a0<span style=\"font-weight: 400;\">trace the user\u2019s entire<\/span> path, no matter which page they landed on and\u00a0when they submitted the form.<\/p>\n<p>GA Connector remembers the initial channel, as well as the last channel, plus other useful information about this visitor.<\/p>\n<p>Here is a section you will see for each of your Salesforce leads after implementing GA Connector:<\/p>\n<div id=\"attachment_43\" style=\"width: 809px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-43\" class=\"wp-image-43 size-full\" src=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/gaconnector-section.png\" alt=\"GA Connector: Tracking website visitor information inside Google Analytics\" width=\"799\" height=\"458\" srcset=\"https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/gaconnector-section.png 799w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/gaconnector-section-300x172.png 300w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/gaconnector-section-768x440.png 768w, https:\/\/gaconnector.com\/blog\/wp-content\/uploads\/2017\/03\/gaconnector-section-788x452.png 788w\" sizes=\"(max-width: 799px) 100vw, 799px\" \/><p id=\"caption-attachment-43\" class=\"wp-caption-text\">GA Connector: Tracking website visitor information inside Salesforce<\/p><\/div>\n<h3><strong><a href=\"https:\/\/gaconnector.com\/salesforce-google-analytics\">Sign up for GA Connector here.<\/a><\/strong><\/h3>\n","protected":false},"excerpt":{"rendered":"<p>This guide shows you how to track UTM parameters in Salesforce Web-to-Lead forms. Salesforce Web-to-Lead forms are great at creating leads in Salesforce\u00a0for each submission. But they don&#8217;t tell you where your leads come from. What websites referred them? Which Adwords keyword brought them to your site? Which Facebook ad campaign converted them? Overview of&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"yst_prominent_words":[698,697,699,21,692,691,686,39,695,688,694,701,690,392,689,390,687,685,696,693],"_links":{"self":[{"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/posts\/7"}],"collection":[{"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/comments?post=7"}],"version-history":[{"count":99,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions"}],"predecessor-version":[{"id":1172,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/posts\/7\/revisions\/1172"}],"wp:attachment":[{"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/media?parent=7"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/categories?post=7"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/tags?post=7"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/gaconnector.com\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=7"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}