{"id":133,"date":"2010-03-03T14:04:55","date_gmt":"2010-03-03T14:04:55","guid":{"rendered":"http:\/\/www.techivity.com\/?p=133"},"modified":"2010-03-03T14:04:55","modified_gmt":"2010-03-03T14:04:55","slug":"google-analytics-for-wordpress-my-favorite-plugin","status":"publish","type":"post","link":"https:\/\/www.techivity.com\/?p=133","title":{"rendered":"Google Analytics for WordPress: My Favorite Plugin"},"content":{"rendered":"<p>A &#8220;how-to&#8221; post about installing Google Analytics in WordPress. \u00a0Soon we&#8217;ll cover some strategy, traffic building and why web analytics are important, plus information on what to read in Google Analytics.<\/p>\n<p>This post will describe how to set up my current favorite Google Analytics plug-in for WordPress.\u00a0 I&#8217;ll be doing a Joomla plug-in soon, for those of you that use Joomla.<\/p>\n<p>I personally prefer Google Analytics because they are free, relatively easy to set-up and provide more information than most need anyway.\u00a0 The interface isn&#8217;t the easiest to read, but I think the fact that they are free, and provide the info needed makes up for that.\u00a0 Plus, Google Analytics are ubiquitous on the web, so there are a lot of plug-ins that support them.\u00a0 Just about everybody has Analytics these days, including Godaddy, Yahoo, etc&#8230;frankly so far I haven&#8217;t seen anyone giving away what Google gives away.<\/p>\n<p>There are two ways to get Google Analytics into your WordPress blog; you can link the source code into the template, or you can install a plug-in.\u00a0 Both methods have pros and cons.\u00a0 I&#8217;d like to suggest the plug-in because if you change your template, the analytics will remain without coding.\u00a0 If you like to run WordPress without many plug-ins then you&#8217;ll want to put the code in the template.<\/p>\n<p>First, you need a Google Analytics account.\u00a0 Go to analytics.google.com and sign up using your Google Login.\u00a0 If you don&#8217;t have a Google Login, get one. \u00a0You can invite other Google Accounts to get into analytics to share information, so set up analytics in your account first and then invite them.<\/p>\n<p>The piece of information you need is the tracking ID: UA-XXXXXXXX-X which you will pull out of the block of code Google gives you as you set up the analytics account.<\/p>\n<p>My favorite WordPress plugin for Google Analytics at the moment is <a href=\"http:\/\/wordpress.org\/extend\/plugins\/google-analyticator\/\" target=\"_blank\">Google Analyticator<\/a> by <a href=\"http:\/\/ronaldheft.com\/\" target=\"_blank\">Ronald Heft<\/a> because it adds a widget to the dashboard of WordPress with some basic analytics data, it works, and its pretty easy to setup.<\/p>\n<p>To install that plugin, just go to &#8220;Plugins&#8221; in the WordPress dashboard, pick &#8220;Add New&#8221;, search on &#8220;Google Analyticator&#8221; and click &#8220;Install&#8221; on the right side.<\/p>\n<p>Once its installed, click on &#8220;Activate this plugin&#8221; to activate it.\u00a0 After the page reloads, click on &#8220;Settings&#8221; on the left-hand side to open the Settings menu and click on &#8220;Google Analytics&#8221; to enter your specific setup information.<\/p>\n<p>There are two settings you have to change to get analytics tracking your site.<\/p>\n<div id=\"attachment_137\" style=\"width: 360px\" class=\"wp-caption alignright\"><a href=\"http:\/\/www.techivity.com\/wp-content\/uploads\/2010\/02\/google-analytics-wordpress.jpg\"><img aria-describedby=\"caption-attachment-137\" loading=\"lazy\" class=\"size-full wp-image-137\" title=\"google-analytics-wordpress\" src=\"http:\/\/www.techivity.com\/wp-content\/uploads\/2010\/02\/google-analytics-wordpress.jpg\" alt=\"Image of Google Analytics in WordPress\" width=\"350\" height=\"306\" \/><\/a><p id=\"caption-attachment-137\" class=\"wp-caption-text\">Enable and Enter Your Tracking ID<\/p><\/div>\n<p>First, you have to enable the plug-in on the drop down menu at the top.<\/p>\n<p>Second, you have to enter your tracking ID, that number that goes UA-XXXXXXXX-X which you get from the Google Analytics code block (which you will see setting up a new analytics account), right after the part that says &#8220;getTracker&#8221;:<\/p>\n<p>&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\nvar gaJsHost = ((&#8220;https:&#8221; == document.location.protocol) ? &#8220;https:\/\/ssl.&#8221; : &#8220;http:\/\/www.&#8221;);<br \/>\ndocument.write(unescape(&#8220;%3Cscript src='&#8221; + gaJsHost + &#8220;google-analytics.com\/ga.js&#8217; type=&#8217;text\/javascript&#8217;%3E%3C\/script%3E&#8221;));<br \/>\n&lt;\/script&gt;<br \/>\n&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\ntry {<br \/>\nvar pageTracker = _gat._getTracker(&#8220;<span style=\"color: #ff0000;\"><em>UA-XXXXXXXX-X<\/em><\/span>&#8220;);<br \/>\npageTracker._trackPageview();<br \/>\n} catch(err) {}&lt;\/script&gt;<\/p>\n<p><input id=\"gwProxy\" type=\"hidden\" \/> <input id=\"jsProxy\" onclick=\"jsCall();\" type=\"hidden\" \/> <input id=\"gwProxy\" type=\"hidden\" \/><\/p>\n<p><!--Session data-->After you&#8217;ve entered your Tracking ID and enabled the plugin scroll down and click on update. \u00a0(And by the way, if you&#8217;re embedding the code into your Template instead, that&#8217;s the code. \u00a0It should go in the Footer.php file, or at the bottom of Index.php, right above the &lt;\/body&gt; tag.)<\/p>\n<p>Now, if you want your WordPress dashboard to display your analytics information, you have to also authenticate the plug-in with Google, so that it can pull the data. \u00a0Just click on the Authenticate this plugin link right under where you enabled the plug-in and log into Google. \u00a0If you&#8217;re doing this for a client, make sure and use THEIR Google account so that only their analytics accounts show up, if you have multiple ones, they&#8217;ll be visible in WordPress.<\/p>\n<p>Its nice to have that little bit of analytics data right in the WordPress control panel.<\/p>\n<p>So that&#8217;s it, if you got all these steps, then within 24 hours you will start seeing analytics data in your Google Analytics account!<\/p>\n<div id=\"_mcePaste\" style=\"overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;\">http:\/\/ronaldheft.com\/code\/analyticator\/<\/div>\n<p><input id=\"gwProxy\" type=\"hidden\" \/> <input id=\"jsProxy\" onclick=\"jsCall();\" type=\"hidden\" \/> <input id=\"gwProxy\" type=\"hidden\" \/> <input id=\"jsProxy\" onclick=\"jsCall();\" type=\"hidden\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A &#8220;how-to&#8221; post about installing Google Analytics in WordPress. \u00a0Soon we&#8217;ll cover some strategy, traffic building and why web analytics are important, plus information on what to read in Google Analytics. This post will describe how to set up my current favorite Google Analytics plug-in for WordPress.\u00a0 I&#8217;ll be doing a Joomla plug-in soon, for [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[14,34,39,40],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.techivity.com\/index.php?rest_route=\/wp\/v2\/posts\/133"}],"collection":[{"href":"https:\/\/www.techivity.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techivity.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techivity.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techivity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=133"}],"version-history":[{"count":0,"href":"https:\/\/www.techivity.com\/index.php?rest_route=\/wp\/v2\/posts\/133\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.techivity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techivity.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techivity.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}