{"id":8747,"date":"2015-04-27T16:56:14","date_gmt":"2015-04-27T15:56:14","guid":{"rendered":"https:\/\/wp.okra.host\/article\/enabling-google-analytics-support\/"},"modified":"2021-03-07T14:49:27","modified_gmt":"2021-03-07T13:49:27","slug":"enabling-google-analytics-support","status":"publish","type":"ht_kb","link":"https:\/\/kb.okra.host\/de\/article\/enabling-google-analytics-support\/","title":{"rendered":"Enabling Google Analytics support"},"content":{"rendered":"<h2 id=\"overview\" >Overview<\/h2>\n<p><a href=\"http:\/\/google.com\/analytics\">Google Analytics<\/a> is a free web analytics\u00a0application\u00a0provided by Google, including SEO recommendations and live site traffic.<\/p>\n<div id=\"attachment_963\" style=\"width: 310px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/kb.okra.host\/wp-content\/uploads\/2015\/04\/rwd-dashboard.png\" rel=\"lightbox-0\"><img decoding=\"async\" aria-describedby=\"caption-attachment-963\" loading=\"lazy\" class=\"size-medium wp-image-963\" src=\"https:\/\/kb.okra.host\/wp-content\/uploads\/2015\/04\/rwd-dashboard-300x239.png\" alt=\"Sample Google Analytics dashboard\" width=\"300\" height=\"239\" \/><\/a><\/p>\n<p id=\"caption-attachment-963\" class=\"wp-caption-text\">Sample Google Analytics dashboard<\/p>\n<\/div>\n<h2 id=\"setting-up-ga\" >Setting up GA<\/h2>\n<p>Google Analytics can be enabled on newer, <a title=\"Determining platform version\" href=\"https:\/\/kb.okra.host\/platform\/determining-platform-version\/\">v5+ platforms<\/a>\u00a0using two lines in a <a title=\".htaccess Guide\" href=\"https:\/\/kb.okra.host\/guides\/htaccess-guide\/\">.htaccess file<\/a>.<\/p>\n<ol>\n<li>Visit <a href=\"http:\/\/google.com\/analytics\">Google Analytics<\/a>\u00a0to create a\u00a0<a href=\"https:\/\/support.google.com\/analytics\/answer\/1009694?hl=en\">profile<\/a> for the domain\n<ul>\n<li>Once the profile is created, you will see sample code to insert:\n<pre data-language=\"javascript\"><code>&lt;script&gt;\r\n (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\r\n (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\r\n m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\r\n })(window,document,'script','\/\/www.google-analytics.com\/analytics.js','ga');\r\nga('create', 'UA-99999000-1', 'auto');\r\n ga('send', 'pageview');\r\n&lt;\/script&gt;<\/code><\/pre>\n<\/li>\n<li>Write down your <strong>account number<\/strong>, bolded above, which follows the form\u00a0<em>UA-XXXXXXXX-X<\/em><\/li>\n<li>It is unnecessary to add the\u00a0sample code above. This will be added\u00a0automatically via <a href=\"https:\/\/developers.google.com\/speed\/pagespeed\/module\">mod_pagespeed<\/a> in the following step<\/li>\n<\/ul>\n<\/li>\n<li>Create a file, if it does not exist, named <code>.htaccess<\/code> in the <a title=\"Where is site content served from?\" href=\"https:\/\/kb.okra.host\/web-content\/where-is-site-content-served-from\/\">document root<\/a> for the domain\u00a0to enable statistics reporting<\/li>\n<li>Add the following lines:<br \/>\n<code>ModPagespeedEnableFilters insert_ga<\/code><br \/>\n<code>ModPagespeedAnalyticsID UA-XXXXXXXX-X<\/code><\/p>\n<ul>\n<li>Where <em>UA-XXXXXXX-X<\/em> is the <strong>account number<\/strong> previously generated by Google<\/li>\n<\/ul>\n<\/li>\n<li>Voila! Wait 24 hours for statistics to generate within\u00a0<a href=\"http:\/\/google.com\/analytics\">Google Analytics&#8217;<\/a> dashboard<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Overview Google Analytics is a free web analytics\u00a0application\u00a0provided by Google, including SEO recommendations and live site traffic. Sample Google Analytics dashboard Setting up GA Google Analytics can be enabled on newer, v5+ platforms\u00a0using two lines in a .htaccess file. Visit Google Analytics\u00a0to create a\u00a0profile for the domain Once the profile&#8230;<\/p>","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"footnotes":""},"ht-kb-category":[54],"ht-kb-tag":[],"class_list":["post-8747","ht_kb","type-ht_kb","status-publish","format-standard","has-post-thumbnail","hentry","ht_kb_category-web-content"],"_links":{"self":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8747","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/comments?post=8747"}],"version-history":[{"count":1,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8747\/revisions"}],"predecessor-version":[{"id":8748,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb\/8747\/revisions\/8748"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/media\/8749"}],"wp:attachment":[{"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/media?parent=8747"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-category?post=8747"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/kb.okra.host\/de\/wp-json\/wp\/v2\/ht-kb-tag?post=8747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}