{"id":1199,"date":"2017-11-30T12:07:35","date_gmt":"2017-11-30T12:07:35","guid":{"rendered":"http:\/\/support.gaconnector.com\/?p=1199"},"modified":"2025-09-26T16:44:40","modified_gmt":"2025-09-26T16:44:40","slug":"how-to-push-ga-connector-data-to-intercom","status":"publish","type":"post","link":"https:\/\/gaconnector.com\/docs\/how-to-push-ga-connector-data-to-intercom\/","title":{"rendered":"How to push GA Connector data to Intercom"},"content":{"rendered":"<p data-pm-slice=\"1 1 [&quot;blockquote&quot;,{}]\">The instructions below apply to\u00a0<strong>Cookie-Based integration<\/strong>.<\/p>\n<p data-pm-slice=\"1 1 [&quot;blockquote&quot;,{}]\">If you are using\u00a0<strong>API-Based integration<\/strong>, you will need to follow the <strong>Cookie-Based integration<\/strong>\u00a0steps instead.<\/p>\n<p data-pm-slice=\"1 1 [&quot;blockquote&quot;,{}]\">Not sure which instructions to follow? Start here:\u00a0<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<p data-pm-slice=\"1 1 [&quot;blockquote&quot;,{}]\">\n<p>To push GA Connector data to Intercom, all you need to do is to add this line of JavaScript code to GA Connector tracking code:<\/p>\n<pre class=\"lang:default decode:true \">Intercom('update', gaFields);<\/pre>\n<p>You need to add it right after &#8220;var gaFields = gaconnector.getCookieValues();&#8221; like shown below:<\/p>\n<pre class=\"lang:default decode:true\">&lt;script type=\"text\/javascript\" src=\"https:\/\/tracker.gaconnector.com\/gaconnector.js\"&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\nfunction\r\nsetGaconnectorHiddenFields() {\r\n    var gaFields = gaconnector.getCookieValues();\r\n\r\n    Intercom('update', gaFields);\r\n\r\n    for (var fieldName in\r\ngaFields) {\r\n        var selectors = 'form input[name=\"' + fieldName + '\"], form input#' + fieldName + ', form input#field_' + fieldName + ', form input[name=\"' + fieldName.toLowerCase() + '\"], form input#' + fieldName.toLowerCase() + ', form input#field_' + fieldName.toLowerCase() + ', input[value=\"gaconnector_' + fieldName +'\"]';\r\n        var inputs = document.querySelector(selectors);\r\n        if (inputs === null) {\r\n            continue;\r\n        } else if (typeof inputs.length === 'undefined') {\r\n            inputs.value = gaFields[fieldName];\r\n            jQuery(document).ready(function() {\r\n                jQuery(inputs).trigger('change');\r\n            });\r\n        } else {\r\n            for (var i = 0; i &lt; inputs.length; i++) {\r\n                inputs[i].value = gaFields[fieldName];\r\n                jQuery(document).ready(function() {\r\n                    jQuery(inputs).trigger('change');\r\n                });\r\n            }\r\n        }\r\n    }\r\n}\r\nsetGaconnectorHiddenFields();\r\ngaconnector.setCallback(setGaconnectorHiddenFields);\r\nsetInterval(setGaconnectorHiddenFields, 1000);\r\n&lt;\/script&gt;<\/pre>\n<p>&nbsp;<\/p>\n<p>As a result, you&#8217;ll see GA Connector data in the right section of the chat, under &#8220;Details&#8221;:<\/p>\n<figure id=\"attachment_1200\" aria-describedby=\"caption-attachment-1200\" style=\"width: 694px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-1200\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/75755f430ce3c60e29678c4e799f566f.png\" alt=\"GA Connector fields in Intercom\" width=\"694\" height=\"754\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/75755f430ce3c60e29678c4e799f566f.png 694w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/75755f430ce3c60e29678c4e799f566f-276x300.png 276w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/75755f430ce3c60e29678c4e799f566f-55x60.png 55w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/75755f430ce3c60e29678c4e799f566f-138x150.png 138w\" sizes=\"(max-width: 694px) 100vw, 694px\" \/><figcaption id=\"caption-attachment-1200\" class=\"wp-caption-text\">GA Connector fields in Intercom<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The instructions below apply to\u00a0Cookie-Based integration. If you are using\u00a0API-Based integration, you will need to follow the Cookie-Based integration\u00a0steps instead. Not sure which instructions to follow? Start here:\u00a0How to Check Which GA Connector Integration Type You\u2019re Using. To push GA Connector data to Intercom, all you need to do is to add this line of [&hellip;]<\/p>\n","protected":false},"author":1,"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\/1199"}],"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=1199"}],"version-history":[{"count":3,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/1199\/revisions"}],"predecessor-version":[{"id":3745,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/1199\/revisions\/3745"}],"wp:attachment":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/media?parent=1199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/categories?post=1199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/tags?post=1199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}