{"id":147,"date":"2011-10-20T12:18:21","date_gmt":"2011-10-20T17:18:21","guid":{"rendered":"http:\/\/www.marcblase.com\/blog\/?p=147"},"modified":"2011-12-08T09:30:05","modified_gmt":"2011-12-08T15:30:05","slug":"google-analytics-asynchronous-loading","status":"publish","type":"post","link":"https:\/\/ma.rcbla.se\/blog\/2011\/10\/google-analytics-asynchronous-loading\/","title":{"rendered":"Google Analytics Asynchronous Loading"},"content":{"rendered":"<p>Tired of ga.js holding up the load time of your site. Give the code below a try and have it load <em>in-line<\/em> with your content.<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;script&gt;\r\n  var _gaq = _gaq || &#x5B;];\r\n  _gaq.push(&#x5B;'_setAccount', 'UA-XXXXX-X']); &amp;lt;!-- Change this to your site ID --&amp;gt;\r\n  _gaq.push(&#x5B;'_trackPageview']);\r\n  (function() {\r\n    var ga = document.createElement('script');\r\n    ga.type = 'text\/javascript';\r\n    ga.async = true;\r\n    ga.src = ('https:' == document.location.protocol ? 'https:\/\/ssl' : 'http:\/\/www') + '.google-analytics.com\/ga.js';\r\n    var s = document.getElementsByTagName('script')&#x5B;0];\r\n    s.parentNode.insertBefore(ga, s);\r\n  })();\r\n&lt;\/script&gt;\r\n<\/pre>\n<p><small>Many thanks to <a href=\"http:\/\/mathiasbynens.be\/notes\/async-analytics-snippet\">mathiasbynens.be<\/a> for sharing.<\/small><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tired of ga.js holding up the load time of your site. Give the code below a try and have it load in-line with your content. &lt;script&gt; var _gaq = _gaq || &#x5B;]; _gaq.push(&#x5B;&#8217;_setAccount&#8217;, &#8216;UA-XXXXX-X&#8217;]); &amp;lt;!&#8211; Change this to your site ID &#8211;&amp;gt; _gaq.push(&#x5B;&#8217;_trackPageview&#8217;]); (function() { var ga = document.createElement(&#8216;script&#8217;); ga.type = &#8216;text\/javascript&#8217;; ga.async = true; [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,3],"tags":[14],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-coding","category-discoveries","tag-javascript"],"_links":{"self":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":8,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":149,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/posts\/147\/revisions\/149"}],"wp:attachment":[{"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ma.rcbla.se\/blog\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}