{"id":273,"date":"2017-07-27T07:30:44","date_gmt":"2017-07-27T07:30:44","guid":{"rendered":"http:\/\/support.gaconnector.com\/?p=273"},"modified":"2025-07-09T10:47:48","modified_gmt":"2025-07-09T10:47:48","slug":"how-to-set-up-google-analytics-link-field-in-salesforce","status":"publish","type":"post","link":"https:\/\/gaconnector.com\/docs\/how-to-set-up-google-analytics-link-field-in-salesforce\/","title":{"rendered":"How to set up &#8220;Google Analytics Link&#8221; field in Salesforce"},"content":{"rendered":"<h4><strong>At the moment this field can&#8217;t be used with GA4. Please skip this field and don&#8217;t follow the steps below.<\/strong><\/h4>\n<hr \/>\n<p>So you have installed the\u00a0<a href=\"https:\/\/gaconnector.com\/docs\/documentation-for-our-basic-integration-salesforce-package\/\">GA Connector package<\/a> on Salesforce and brought\u00a0all fields from the website into Salesforce.<\/p>\n<p>Since Google Analytics URLs are unique per account, you&#8217;ll need to set up the formula on &#8220;<em>Google Analytics Link<\/em>&#8221; in Salesforce so that it matches the account that you are using.<\/p>\n<p>We have prepared a tool for you below so that it would automatically generate the\u00a0formula for you based on your Google Analytics URL.<\/p>\n<p>1. Go to your Google Analytics dashboard and copy the URL of the page<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-280\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/d12ba60aee9c3020b933608cbaf52d0e.png\" alt=\"Copy User Explorer URL for a selected user\" width=\"2564\" height=\"150\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/d12ba60aee9c3020b933608cbaf52d0e.png 2564w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/d12ba60aee9c3020b933608cbaf52d0e-300x18.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/d12ba60aee9c3020b933608cbaf52d0e-768x45.png 768w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/d12ba60aee9c3020b933608cbaf52d0e-700x41.png 700w\" sizes=\"(max-width: 2564px) 100vw, 2564px\" \/><\/p>\n<p>2. Paste the URL to the Salesforce Formula Generator below and click on Generate Link:<\/p>\n<form id=\"parseGAForm\">\n                <h4>Enter your Google Analytics URL<\/h4>\n                <div class=\"form-group\" id=\"websiteUrl\">\n                    <input type=\"text\" class=\"form-control\" required name=\"ga_url\" id=\"ga_url\">\n                    <button type=\"submit\" class=\"btn btn-crm enjoy_btn\">Generate Link<\/button>\n                    <div id=\"errMsg\"><\/div>\n                <\/div>\n                <div class=\"formula-container\">\n                    <pre id=\"gaLinkFormula\"><\/pre>\n                <\/div>\n            <\/form>\n<h2>Setting up the field in Salesforce<\/h2>\n<p>1. Go to Salesforce &#8211; Setup, and search for &#8220;Leads&#8221;:<\/p>\n<figure id=\"attachment_284\" aria-describedby=\"caption-attachment-284\" style=\"width: 470px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-284\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/236ba1270dbec4297a6b013b47cb3a5a.png\" alt=\"Search for Leads in Salesforce\" width=\"470\" height=\"564\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/236ba1270dbec4297a6b013b47cb3a5a.png 470w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/236ba1270dbec4297a6b013b47cb3a5a-250x300.png 250w\" sizes=\"(max-width: 470px) 100vw, 470px\" \/><figcaption id=\"caption-attachment-284\" class=\"wp-caption-text\">Search for Leads in Salesforce<\/figcaption><\/figure>\n<p>2. Click on &#8220;Fields&#8221;.<\/p>\n<p>3. Somewhere on the page, locate &#8220;<em>Google Analytics Link<\/em>&#8221; field:<\/p>\n<figure id=\"attachment_285\" aria-describedby=\"caption-attachment-285\" style=\"width: 770px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-285\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/05e36e36ffea7acfb6dacf251eade315-1.png\" alt=\"Locate Google Analytics Link\" width=\"770\" height=\"198\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/05e36e36ffea7acfb6dacf251eade315-1.png 770w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/05e36e36ffea7acfb6dacf251eade315-1-300x77.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/05e36e36ffea7acfb6dacf251eade315-1-768x197.png 768w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/07\/05e36e36ffea7acfb6dacf251eade315-1-700x180.png 700w\" sizes=\"(max-width: 770px) 100vw, 770px\" \/><figcaption id=\"caption-attachment-285\" class=\"wp-caption-text\">Locate Google Analytics Link<\/figcaption><\/figure>\n<p>4. Click on &#8220;Edit&#8221; to the left of this field.<\/p>\n<p>5.\u00a0Replace the contents of this field with the code generated by our tool above.<\/p>\n<p>6. Click on &#8220;Save&#8221;.<\/p>\n<h4><strong>If you are using Salesforce Lightning Experience, you can set up the &#8220;<em>Google Analytics Link<\/em>&#8221; field\u00a0by following\u00a0 the steps below:<\/strong><\/h4>\n<ol>\n<li>Go to\u00a0<strong>Setup<\/strong> &gt; <strong>Object Manager<\/strong><\/li>\n<li>Find and click on &#8220;<strong>Lead&#8221;<\/strong><\/li>\n<li>Select <strong>Fields &amp; Relationships<\/strong><\/li>\n<li>Select and Edit &#8220;<strong>Google Analytics Link<\/strong>&#8220;<\/li>\n<li>Replace the contents of this field with the code generated by our tool above.<\/li>\n<li>Click on &#8220;<strong>Save<\/strong>&#8220;.<\/li>\n<\/ol>\n<p>Viola! Now\u00a0when you click on Google Analytics Link in your Leads,\u00a0it will take you to the User Explorer report for the selected\u00a0lead.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At the moment this field can&#8217;t be used with GA4. Please skip this field and don&#8217;t follow the steps below. So you have installed the\u00a0GA Connector package on Salesforce and brought\u00a0all fields from the website into Salesforce. Since Google Analytics URLs are unique per account, you&#8217;ll need to set up the formula on &#8220;Google Analytics [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32,16,21],"tags":[],"_links":{"self":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/273"}],"collection":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/comments?post=273"}],"version-history":[{"count":20,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/273\/revisions"}],"predecessor-version":[{"id":3617,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/273\/revisions\/3617"}],"wp:attachment":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/media?parent=273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/categories?post=273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/tags?post=273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}