{"id":1116,"date":"2017-11-19T12:02:10","date_gmt":"2017-11-19T12:02:10","guid":{"rendered":"http:\/\/support.gaconnector.com\/?p=1116"},"modified":"2025-08-01T12:29:41","modified_gmt":"2025-08-01T12:29:41","slug":"install-ga-connector-2-0-tracking-code","status":"publish","type":"post","link":"https:\/\/gaconnector.com\/docs\/install-ga-connector-2-0-tracking-code\/","title":{"rendered":"Install GA Connector Tracking Code (API-based integration)"},"content":{"rendered":"<h3>In this article, we&#8217;ll show you how to install GA Connector tracking code\u00a0on\u00a0your website<\/h3>\n<p>To start tracking, please put this script on your website:<\/p>\n<pre class=\"lang:default decode:true\">&lt;script src=\"https:\/\/track.gaconnector.com\/gaconnector.js\" type=\"text\/javascript\"&gt;&lt;\/script&gt;\r\n&lt;script type=\"text\/javascript\"&gt;gaconnector2.track('YOUR GA CONNECTOR ACCOUNT ID');&lt;\/script&gt;<\/pre>\n<p>But instead of\u00a0<strong>YOUR GA CONNECTOR ACCOUNT ID<\/strong>, please use the account ID that we have provided during the signup process. If you haven\u2019t received yours yet, please email support@gaconnector.com.<\/p>\n<h3>WordPress<\/h3>\n<p>If you&#8217;re using WordPress:<\/p>\n<ol>\n<li>Download\u00a0our plugin\u00a0<a href=\"http:\/\/zuev.software\/download\/ga-connector-plugin.zip\">here<\/a>.<\/li>\n<li>Go to WordPress admin panel -&gt; Plugins -&gt; Add New -&gt; Upload Plugin, choose file ga-connector-2.0.zip and then activate it.<br \/>\n<img decoding=\"async\" class=\"alignnone wp-image-2137 size-full\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/Screenshot_10.png\" alt=\"Activate GA Connector plugin\" width=\"421\" height=\"79\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/Screenshot_10.png 421w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/Screenshot_10-300x56.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/Screenshot_10-60x11.png 60w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/Screenshot_10-150x28.png 150w\" sizes=\"(max-width: 421px) 100vw, 421px\" \/><\/li>\n<li>Go to Settings &#8211; GA Connector and set your GA Connector ID.\u00a0If you haven\u2019t received yours yet, please email support@gaconnector.com.<img decoding=\"async\" class=\"alignnone wp-image-2138 size-large\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/Screenshot_14-700x244.png\" alt=\"GA Connector account id\" width=\"700\" height=\"244\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/Screenshot_14-700x244.png 700w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/Screenshot_14-300x104.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/Screenshot_14-60x21.png 60w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/Screenshot_14-150x52.png 150w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/11\/Screenshot_14.png 761w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/li>\n<\/ol>\n<h3>Placement Requirements<\/h3>\n<ul>\n<li>This code should ideally\u00a0be put<strong>\u00a0in the very beginning of the &lt;body&gt; tag<\/strong>, or in the &lt;head&gt;. If it\u2019s put in the middle or at the end of &lt;body&gt;, some visitors who don\u2019t wait until the whole page loads, won\u2019t be tracked correctly.<\/li>\n<li>The code needs to be put\u00a0<strong>on every page of the website<\/strong>, or at least on every page that can potentially the first one that user opens on the website.<\/li>\n<\/ul>\n<h3>Integrating with GA Connector if your form is inside a cross-domain iframe<\/h3>\n<p>If your website forms are located inside a cross-domain iframe, add this\u00a0JavaScript code inside that iframe (in addition to the tracking code above on the main page):<\/p>\n<pre class=\"lang:default decode:true\">&lt;script src=\"https:\/\/track.gaconnector.com\/gaconnector-iframe.js\" type=\"text\/javascript\"&gt;&lt;\/script&gt;\r\n&lt;script type=\"text\/javascript\"&gt;gaconnector2.track('YOUR GA CONNECTOR ACCOUNT ID');&lt;\/script&gt;<\/pre>\n<h3>Integrating with multiple domains<\/h3>\n<p>If you are using multiple domains, you should replace the second line of the GA Connector code with this (but use your own domain names instead of domain1.com and domain2.com; also, feel free to add more domains):<\/p>\n<pre class=\"lang:default decode:true\">&lt;script type=\"text\/javascript\"&gt;gaconnector2.track(\"YOUR GA CONNECTOR ACCOUNT ID\",{internalDomains:[\"domain1.com\",\"domain2.com\"], storageEngine: 'cookies'});&lt;\/script&gt;<\/pre>\n<h3>Setting up GA Connector with Consent Banners<\/h3>\n<p>If you are using cookie consent banner in your website, make sure to follow the steps outlined <a href=\"https:\/\/gaconnector.com\/docs\/setting-up-gaconnector-with-consent-banners\/\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we&#8217;ll show you how to install GA Connector tracking code\u00a0on\u00a0your website To start tracking, please put this script on your website: &lt;script src=&#8221;https:\/\/track.gaconnector.com\/gaconnector.js&#8221; type=&#8221;text\/javascript&#8221;&gt;&lt;\/script&gt; &lt;script type=&#8221;text\/javascript&#8221;&gt;gaconnector2.track(&#8216;YOUR GA CONNECTOR ACCOUNT ID&#8217;);&lt;\/script&gt; But instead of\u00a0YOUR GA CONNECTOR ACCOUNT ID, please use the account ID that we have provided during the signup process. If you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[45,32],"tags":[],"_links":{"self":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/1116"}],"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=1116"}],"version-history":[{"count":28,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/1116\/revisions"}],"predecessor-version":[{"id":3663,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/1116\/revisions\/3663"}],"wp:attachment":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/media?parent=1116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/categories?post=1116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/tags?post=1116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}