{"id":68,"date":"2015-06-28T20:45:05","date_gmt":"2015-06-28T20:45:05","guid":{"rendered":"http:\/\/www.revolutionsf.com\/revblogs\/?p=68"},"modified":"2015-06-29T18:11:07","modified_gmt":"2015-06-29T18:11:07","slug":"revblogging-updates-and-analytics-capabilities","status":"publish","type":"post","link":"https:\/\/www.revolutionsf.com\/revblogs\/blog\/2015\/revblogging-updates-and-analytics-capabilities\/","title":{"rendered":"RevBlogging Updates and Analytics Capabilities"},"content":{"rendered":"<p>Howdy, RevBloggers! I&#8217;ve been doing some maintenance to the blogs today. WordPress has been updated to the most current version, as well as all the plugins which you know and love. <\/p>\n<p>If you&#8217;re interested in tracking the visitors to your site, I&#8217;ve just implemented the StatCounter plugin. This requires a sign-in at the StatCounter site to activate for your individual blog. I have not actually tried this myself, so I don&#8217;t know if that will work. Let me know if you try it!<\/p>\n<p>Also, there&#8217;s been some snafus with the Google Analytics tracking, which I had thought was working fine, but in fact it had completely disappeared, apparently some time ago. This is probably because the themes on a multi-site installation are prone to updating and destruction of any hard-coded javascript additions. <\/p>\n<p>So, I spent most of this afternoon figuring out how to enqueue Google Analytics javascript snippets into the header of every sub-site in the RevBlog network. If you&#8217;re googling the answer to this question, the secret is to put a micro-plugin into the folder \/wp-content\/mu-plugins. Here&#8217;s the code:<\/p>\n<p><code><br \/>\n<?php\n\/**\n * @package GA Enqueue MU\n * @version Nada\n *\/\n\/*\nPlugin Name: Ga Enqueue MU\nPlugin URI: nada\nDescription: Adds Google Analytics code to the javascript enqueue function for every site on a WordPress Multi-Site installation. \nAuthor: Matthew Bey\nVersion: nada\nAuthor URI: http:\/\/www.matthewbey.com\n*\/\n\n\n\/\/ Function to add analyticstracking.js to the site\nfunction add_google_analytics() {\n\/\/ Register analyticstracking.js file (Google Analytics)\nwp_register_script(\n'google-analytics', \/\/ handle name referred to in the \"wp_enqueue_script\" call below\nhome_url( $path = '\/wp-content\/mu-plugins' ) . '\/analyticstracking.js', \/\/ location of your file\nfalse, \/\/ no dependencies\n);\n\/\/ Enqueue the registered script file\nwp_enqueue_script('google-analytics');\n}\nadd_action('wp_enqueue_scripts', 'add_google_analytics');\n?><br \/>\n<\/code><\/p>\n<p>This doesn&#8217;t necessarily help you if you&#8217;re a regular blogger who just wants to see how many people are reading your posts. I believe I can have a larger drilldown of performance emailed to you on a regular basis, with all the funky little details which makes Google Analytics so powerful. Let me know if you want one of those, and I&#8217;ll set you up.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Howdy, RevBloggers! I&#8217;ve been doing some maintenance to the blogs today. WordPress has been updated to the most current version, as well as all the plugins which you know and love. If you&#8217;re interested in tracking the visitors to your &hellip; <a href=\"https:\/\/www.revolutionsf.com\/revblogs\/blog\/2015\/revblogging-updates-and-analytics-capabilities\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-68","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v15.2.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.revolutionsf.com\/revblogs\/blog\/2015\/revblogging-updates-and-analytics-capabilities\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RevBlogging Updates and Analytics Capabilities - Revblogs\" \/>\n<meta property=\"og:description\" content=\"Howdy, RevBloggers! I&#8217;ve been doing some maintenance to the blogs today. WordPress has been updated to the most current version, as well as all the plugins which you know and love. If you&#8217;re interested in tracking the visitors to your &hellip; Continue reading &rarr;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.revolutionsf.com\/revblogs\/blog\/2015\/revblogging-updates-and-analytics-capabilities\/\" \/>\n<meta property=\"og:site_name\" content=\"Revblogs\" \/>\n<meta property=\"article:published_time\" content=\"2015-06-28T20:45:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-06-29T18:11:07+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\">\n\t<meta name=\"twitter:data1\" content=\"mbey\">\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\">\n\t<meta name=\"twitter:data2\" content=\"1 minute\">\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.revolutionsf.com\/revblogs\/#website\",\"url\":\"https:\/\/www.revolutionsf.com\/revblogs\/\",\"name\":\"Revblogs\",\"description\":\"All the blogs of all the minds behind RevSF\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.revolutionsf.com\/revblogs\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.revolutionsf.com\/revblogs\/blog\/2015\/revblogging-updates-and-analytics-capabilities\/#webpage\",\"url\":\"https:\/\/www.revolutionsf.com\/revblogs\/blog\/2015\/revblogging-updates-and-analytics-capabilities\/\",\"name\":\"RevBlogging Updates and Analytics Capabilities - Revblogs\",\"isPartOf\":{\"@id\":\"https:\/\/www.revolutionsf.com\/revblogs\/#website\"},\"datePublished\":\"2015-06-28T20:45:05+00:00\",\"dateModified\":\"2015-06-29T18:11:07+00:00\",\"author\":{\"@id\":\"https:\/\/www.revolutionsf.com\/revblogs\/#\/schema\/person\/8d790559a19b5597ebb69b7b744f4c4b\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.revolutionsf.com\/revblogs\/blog\/2015\/revblogging-updates-and-analytics-capabilities\/\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.revolutionsf.com\/revblogs\/#\/schema\/person\/8d790559a19b5597ebb69b7b744f4c4b\",\"name\":\"mbey\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.revolutionsf.com\/revblogs\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ec0048e5e9430f44d486e786b687ccc04ae355c54158c186e99cf279e584940a?s=96&d=mm&r=g\",\"caption\":\"mbey\"},\"description\":\"Matthew is a writer and editor living in Austin, TX. He's also the founder of digital marketing agency Froglet.\",\"sameAs\":[\"https:\/\/lastcastpodcast.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","_links":{"self":[{"href":"https:\/\/www.revolutionsf.com\/revblogs\/wp-json\/wp\/v2\/posts\/68","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.revolutionsf.com\/revblogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.revolutionsf.com\/revblogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.revolutionsf.com\/revblogs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.revolutionsf.com\/revblogs\/wp-json\/wp\/v2\/comments?post=68"}],"version-history":[{"count":2,"href":"https:\/\/www.revolutionsf.com\/revblogs\/wp-json\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":70,"href":"https:\/\/www.revolutionsf.com\/revblogs\/wp-json\/wp\/v2\/posts\/68\/revisions\/70"}],"wp:attachment":[{"href":"https:\/\/www.revolutionsf.com\/revblogs\/wp-json\/wp\/v2\/media?parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.revolutionsf.com\/revblogs\/wp-json\/wp\/v2\/categories?post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.revolutionsf.com\/revblogs\/wp-json\/wp\/v2\/tags?post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}