{"id":3517,"date":"2025-05-11T15:31:40","date_gmt":"2025-05-11T15:31:40","guid":{"rendered":"https:\/\/gaconnector.com\/docs\/?p=3517"},"modified":"2025-09-20T13:05:12","modified_gmt":"2025-09-20T13:05:12","slug":"integrating-ga-connector-with-highlevel","status":"publish","type":"post","link":"https:\/\/gaconnector.com\/docs\/integrating-ga-connector-with-highlevel\/","title":{"rendered":"Integrating GA Connector with HighLevel (GoHighLevel)"},"content":{"rendered":"<p data-pm-slice=\"1 1 [&quot;blockquote&quot;,{}]\">The instructions below apply to <strong>Cookie-Based integration<\/strong>.<\/p>\n<p data-pm-slice=\"1 1 [&quot;blockquote&quot;,{}]\">If you are using <strong>API-Based integration<\/strong>, simply add the GA Connector script to both your main website and inside the HighLevel form iframe. No additional steps are required.<\/p>\n<p data-pm-slice=\"1 1 [&quot;blockquote&quot;,{}]\">Not sure which instructions to follow? Start here: <strong><a class=\"ProsemirrorEditor-link\" href=\"https:\/\/gaconnector.com\/docs\/how-to-check-which-ga-connector-integration-type-youre-using\/\">How to Check Which GA Connector Integration Type You\u2019re Using<\/a>.<\/strong><\/p>\n<h2>Prerequisites<\/h2>\n<ul>\n<li>Ensure that either the GA Connector WordPress plugin or the GA Connector script is installed on your website.<\/li>\n<\/ul>\n<h2>\u00a0Create GA Connector fields in HighLevel<\/h2>\n<ol>\n<li>Navigate to your HighLevel dashboard and go to <strong data-start=\"47\" data-end=\"75\">Settings &gt; Custom Fields<\/strong>.<\/li>\n<li>Click on <strong data-start=\"9\" data-end=\"22\">Add Field<\/strong> and create a <strong data-start=\"36\" data-end=\"51\">Single Line<\/strong> field for each GA Connector field you wish to track.<img decoding=\"async\" class=\"pt-3 pb-3 alignnone wp-image-3528 size-large\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot2-700x318.png\" alt=\"\" width=\"700\" height=\"318\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot2-700x318.png 700w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot2-300x136.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot2-768x349.png 768w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot2-1536x697.png 1536w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot2-60x27.png 60w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot2-150x68.png 150w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot2.png 1628w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/li>\n<li>Refer to the table below for a comprehensive list of <strong>GA Connector fields<\/strong> and their corresponding Input IDs.<br \/>\n\n<table id=\"tablepress-6\" class=\"tablepress tablepress-id-6\">\n<thead>\n<tr class=\"row-1 odd\">\n\t<th class=\"column-1\">Label<\/th><th class=\"column-2\">Input ID<\/th><th class=\"column-3\">Label<\/th><th class=\"column-4\">Input ID<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-hover\">\n<tr class=\"row-2 even\">\n\t<td class=\"column-1\"><strong>All Traffic Sources <\/strong><\/td><td class=\"column-2\">all_traffic_sources<\/td><td class=\"column-3\"><strong>Last Click Campaign<\/strong><\/td><td class=\"column-4\">lc_campaign<\/td>\n<\/tr>\n<tr class=\"row-3 odd\">\n\t<td class=\"column-1\"><strong>Browser<\/strong><\/td><td class=\"column-2\">browser<\/td><td class=\"column-3\"><strong>Last Click Channel<\/strong><\/td><td class=\"column-4\">lc_channel<\/td>\n<\/tr>\n<tr class=\"row-4 even\">\n\t<td class=\"column-1\"><strong>City (from IP address)<\/strong><\/td><td class=\"column-2\">city<\/td><td class=\"column-3\"><strong>Last Click Content<\/strong><\/td><td class=\"column-4\">lc_content<\/td>\n<\/tr>\n<tr class=\"row-5 odd\">\n\t<td class=\"column-1\"><strong>Country (from IP address)<\/strong><\/td><td class=\"column-2\">country<\/td><td class=\"column-3\"><strong>Last Click Landing Page<\/strong><\/td><td class=\"column-4\">lc_landing<\/td>\n<\/tr>\n<tr class=\"row-6 even\">\n\t<td class=\"column-1\"><strong>First Click Campaign<\/strong><\/td><td class=\"column-2\">fc_campaign<\/td><td class=\"column-3\"><strong>Last Click Medium<\/strong><\/td><td class=\"column-4\">lc_medium<\/td>\n<\/tr>\n<tr class=\"row-7 odd\">\n\t<td class=\"column-1\"><strong>First Click Channel<\/strong><\/td><td class=\"column-2\">fc_channel<\/td><td class=\"column-3\"><strong>Last Click Referrer<\/strong><\/td><td class=\"column-4\">lc_referrer<\/td>\n<\/tr>\n<tr class=\"row-8 even\">\n\t<td class=\"column-1\"><strong>First Click Content<\/strong><\/td><td class=\"column-2\">fc_content<\/td><td class=\"column-3\"><strong>Last Click Source<\/strong><\/td><td class=\"column-4\">lc_source<\/td>\n<\/tr>\n<tr class=\"row-9 odd\">\n\t<td class=\"column-1\"><strong>First Click Landing Page<\/strong><\/td><td class=\"column-2\">fc_landing<\/td><td class=\"column-3\"><strong>Last Click Term<\/strong><\/td><td class=\"column-4\">lc_term<\/td>\n<\/tr>\n<tr class=\"row-10 even\">\n\t<td class=\"column-1\"><strong>First Click Medium <\/strong><\/td><td class=\"column-2\">fc_medium<\/td><td class=\"column-3\"><strong>Last Click Timestamp<\/strong><\/td><td class=\"column-4\">lc_timestamp<\/td>\n<\/tr>\n<tr class=\"row-11 odd\">\n\t<td class=\"column-1\"><strong>First Click Referrer<\/strong><\/td><td class=\"column-2\">fc_referrer<\/td><td class=\"column-3\"><strong>Longitude<\/strong><\/td><td class=\"column-4\">longitude<\/td>\n<\/tr>\n<tr class=\"row-12 even\">\n\t<td class=\"column-1\"><strong>First Click Source<\/strong><\/td><td class=\"column-2\">fc_source<\/td><td class=\"column-3\"><strong>Latitude<\/strong><\/td><td class=\"column-4\">latitude<\/td>\n<\/tr>\n<tr class=\"row-13 odd\">\n\t<td class=\"column-1\"><strong>First Click Term<\/strong><\/td><td class=\"column-2\">fc_term<\/td><td class=\"column-3\"><strong>Number of Website Visits<\/strong><\/td><td class=\"column-4\">page_visits<\/td>\n<\/tr>\n<tr class=\"row-14 even\">\n\t<td class=\"column-1\"><strong>First Click Timestamp<\/strong><\/td><td class=\"column-2\">fc_timestamp<\/td><td class=\"column-3\"><strong>Operating System<\/strong><\/td><td class=\"column-4\">OS<\/td>\n<\/tr>\n<tr class=\"row-15 odd\">\n\t<td class=\"column-1\"><strong>Google Analytics CID<\/strong><\/td><td class=\"column-2\">GA_Client_ID<\/td><td class=\"column-3\"><strong>Device<\/strong><\/td><td class=\"column-4\">device<\/td>\n<\/tr>\n<tr class=\"row-16 even\">\n\t<td class=\"column-1\"><strong>Google Analytics Measurement ID<\/strong><\/td><td class=\"column-2\">GA_Measurement_ID<\/td><td class=\"column-3\"><strong>Region<\/strong><\/td><td class=\"column-4\">region<\/td>\n<\/tr>\n<tr class=\"row-17 odd\">\n\t<td class=\"column-1\"><strong>Google Analytics Session ID<\/strong><\/td><td class=\"column-2\">GA_Session_ID<\/td><td class=\"column-3\"><strong>Pages Visited <\/strong><\/td><td class=\"column-4\">pages_visited_list<\/td>\n<\/tr>\n<tr class=\"row-18 even\">\n\t<td class=\"column-1\"><strong>Google Click Identifier<\/strong><\/td><td class=\"column-2\">gclid<\/td><td class=\"column-3\"><strong>Time Spent on Website <\/strong><\/td><td class=\"column-4\">time_passed<\/td>\n<\/tr>\n<tr class=\"row-19 odd\">\n\t<td class=\"column-1\"><strong>IP Address<\/strong><\/td><td class=\"column-2\">ip_address<\/td><td class=\"column-3\"><strong>Time Zone <\/strong><\/td><td class=\"column-4\">time_zone<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-6 from cache --><\/li>\n<\/ol>\n<h2>Update your Forms<\/h2>\n<ol>\n<li>For each of your forms, add the<strong> GA Connector custom fields<\/strong> you&#8217;ve created.<\/li>\n<li>Update the <strong>Query Key<\/strong> of each added field to match the corresponding GA Connector Input ID from the table above (<em>e.g., for &#8220;Last Click Source,&#8221; use lc_source<\/em>).<br \/>\n<img decoding=\"async\" class=\"pt-3 pb-3 alignnone wp-image-3522 size-large\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot-700x407.png\" alt=\"\" width=\"700\" height=\"407\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot-700x407.png 700w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot-300x175.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot-768x447.png 768w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot-1536x893.png 1536w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot-60x35.png 60w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot-150x87.png 150w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2025\/05\/gohighlevel-scrnshot.png 1738w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/li>\n<li>Ensure that the added fields are set to <strong data-start=\"40\" data-end=\"50\">Hidden<\/strong>.<\/li>\n<li>After adding all necessary fields and setting their Query Keys, insert an <strong data-start=\"74\" data-end=\"95\">HTML form element<\/strong> at the bottom of your form.<\/li>\n<li>Add the following script to the <strong>HTML form element<\/strong>:\n<pre class=\"lang:default decode:true\">&lt;script&gt;\r\n\/* For security, Add Domain of the parent site where the form will be embedded *\/\r\nvar allowedOrigins = ['https:\/\/yourdomainhere.com'];\r\n\r\nvar receiveGaconnectorData = function(event) {\r\n    if (!allowedOrigins.includes(event.origin) || !event.data.lc_source) return;\r\n    var gaFields = event.data;\r\n    for (var fieldName in gaFields) {\r\n        var selectors = \"input[data-q='\" + fieldName + \"']\";\r\n        var inputs = document.querySelectorAll(selectors);\r\n        if (inputs !== null) {\r\n            for (var i = 0; i &lt; inputs.length; i++) {\r\n                inputs[i].value = gaFields[fieldName];\r\n                inputs[i].dispatchEvent(new Event('input'));\r\n            }\r\n        }\r\n    }\r\n};\r\nwindow.addEventListener('message', receiveGaconnectorData);\r\n&lt;\/script&gt;<\/pre>\n<p><em><strong>Replace<\/strong> &#8216;https:\/\/yourdomainhere.com&#8217; with the actual domain where your form is hosted.<\/em><\/li>\n<li>Save your form.<\/li>\n<\/ol>\n<h2>Add Supplemental Code to Your Website<\/h2>\n<ol>\n<li>Add the following code to the pages of your website where your forms are embedded.\n<pre class=\"lang:default decode:true\">&lt;script&gt;\r\n\/* Add the CSS selectors of the iframes to the array, e.g *\/\r\nvar iframeSelectors = ['iframe[data-form-id][data-layout]'];\r\ndocument.addEventListener(\"DOMContentLoaded\", (event) =&gt; {\r\n    function postMessageToGhl() {\r\n        var gaFields = gaconnector.getCookieValues();\r\n        setInterval(function() {\r\n            var formIframes = document.querySelectorAll(iframeSelectors);\r\n            if (formIframes !== null) {\r\n                for (var i = 0; i &lt; formIframes.length; i++) {\r\n                    formIframes[i].contentWindow.postMessage(gaFields, \"*\");\r\n                }\r\n            }\r\n        }, 1000);\r\n    }\r\n    postMessageToGhl();\r\n&lt;\/script&gt;<\/pre>\n<\/li>\n<\/ol>\n<p>That&#8217;s it! Once a web visitor submits your form, the contact created should contain Google Analytics data.<\/p>\n<p>Need help with integrating HighLevel with GA Connector? Feel free to <a href=\"mailto:support@gaconnector.com\">send us a message here<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The instructions below apply to Cookie-Based integration. If you are using API-Based integration, simply add the GA Connector script to both your main website and inside the HighLevel form iframe. No additional steps are required. Not sure which instructions to follow? Start here: How to Check Which GA Connector Integration Type You\u2019re Using. Prerequisites Ensure [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17,16],"tags":[],"_links":{"self":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/3517"}],"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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/comments?post=3517"}],"version-history":[{"count":34,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/3517\/revisions"}],"predecessor-version":[{"id":3714,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/3517\/revisions\/3714"}],"wp:attachment":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/media?parent=3517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/categories?post=3517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/tags?post=3517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}