{"id":467,"date":"2017-08-14T11:35:15","date_gmt":"2017-08-14T11:35:15","guid":{"rendered":"http:\/\/support.gaconnector.com\/?p=467"},"modified":"2020-05-21T06:41:59","modified_gmt":"2020-05-21T06:41:59","slug":"how-to-test-ga-connector-from-localhost","status":"publish","type":"post","link":"https:\/\/gaconnector.com\/docs\/how-to-test-ga-connector-from-localhost\/","title":{"rendered":"How to test GA Connector from localhost"},"content":{"rendered":"<h2>The Problem<\/h2>\n<p>Before deploying GA Connector script to your site, you may want to check how it works on a local machine or on a staging server first.<\/p>\n<p>But you may get this error message in console if you try to do this:<\/p>\n<figure id=\"attachment_466\" aria-describedby=\"caption-attachment-466\" style=\"width: 1992px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-466\" src=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/08\/2bbe1dbb41ebd6656e6d9e7dec1084c7.png\" alt=\"Domain denied\" width=\"1992\" height=\"46\" srcset=\"https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/08\/2bbe1dbb41ebd6656e6d9e7dec1084c7.png 1992w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/08\/2bbe1dbb41ebd6656e6d9e7dec1084c7-300x7.png 300w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/08\/2bbe1dbb41ebd6656e6d9e7dec1084c7-768x18.png 768w, https:\/\/gaconnector.com\/docs\/wp-content\/uploads\/2017\/08\/2bbe1dbb41ebd6656e6d9e7dec1084c7-700x16.png 700w\" sizes=\"(max-width: 1992px) 100vw, 1992px\" \/><figcaption id=\"caption-attachment-466\" class=\"wp-caption-text\">Domain denied<\/figcaption><\/figure>\n<h2>The Solution<\/h2>\n<p><strong>If want to test it on a staging server<\/strong>, just let us know the domain\/subdomain you use for this server, and we&#8217;ll add it to the system (so you can test).<\/p>\n<p>If you want to test it on your local machine,\u00a0just\u00a0add something like this to the hosts file:<\/p>\n<blockquote><p>127.0.0.1 localhost.com<\/p><\/blockquote>\n<p>Put it:<\/p>\n<ul>\n<li>in\u00a0\/etc\/hosts if you on *NIX,<\/li>\n<li>or c:\\windows\\system32\\drivers\\etc\\hosts if you&#8217;re on Windows.<\/li>\n<\/ul>\n<p>This will allow you to open your website locally\u00a0by going to localhost.com (and this domain is added to our database, so it won&#8217;t throw the &#8220;Domain not added&#8221; error).<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Problem Before deploying GA Connector script to your site, you may want to check how it works on a local machine or on a staging server first. But you may get this error message in console if you try to do this: The Solution If want to test it on a staging server, just [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,22],"tags":[],"_links":{"self":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/467"}],"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=467"}],"version-history":[{"count":2,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/467\/revisions"}],"predecessor-version":[{"id":2225,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/posts\/467\/revisions\/2225"}],"wp:attachment":[{"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/media?parent=467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/categories?post=467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gaconnector.com\/docs\/wp-json\/wp\/v2\/tags?post=467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}