{"id":144,"date":"2013-10-20T18:47:23","date_gmt":"2013-10-20T18:47:23","guid":{"rendered":"http:\/\/www.jasonbailey.net\/stuff\/?p=144"},"modified":"2013-10-20T19:07:43","modified_gmt":"2013-10-20T19:07:43","slug":"connecting-to-google-analytics-brighton-php-october-2013","status":"publish","type":"post","link":"http:\/\/www.jasonbailey.net\/stuff\/connecting-to-google-analytics-brighton-php-october-2013\/","title":{"rendered":"Connecting to Google Analytics &#8211; Brighton PHP October 2013"},"content":{"rendered":"<p>This post briefly covers connecting to Google Anayltics with a service account (Google Api Console).<\/p>\n<p>In order to connect to a Google Analytic (GA) profile, the following are needed<\/p>\n<ol>\n<li>A GA profile ID &#8211; the one you want to report on<\/li>\n<li>A service account -email address, client ID and key (download file)<\/li>\n<li>Ensure email address from the service account is permitted to access the google analytics profile<\/li>\n<\/ol>\n<p>Sample PHP code to get the number of visitors to a site (profile ID)<br \/>\n<script type=\"text\/javascript\" src=\"https:\/\/gist.github.com\/espeecat\/7054060.js\"><\/script><\/p>\n<p>Once the GA client is set-up then the following code will return hourly GA data for the given profile.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/espeecat\/7073821.js\"><\/script><\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>This post briefly covers connecting to Google Anayltics with a service account (Google Api Console). In order to connect to a Google Analytic (GA) profile, the following are needed A GA profile ID &#8211; the one you want to report on A service account -email address, client ID and key (download file) Ensure email address [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-144","post","type-post","status-publish","format-standard","hentry","category-big-data"],"_links":{"self":[{"href":"http:\/\/www.jasonbailey.net\/stuff\/wp-json\/wp\/v2\/posts\/144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.jasonbailey.net\/stuff\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jasonbailey.net\/stuff\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jasonbailey.net\/stuff\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jasonbailey.net\/stuff\/wp-json\/wp\/v2\/comments?post=144"}],"version-history":[{"count":8,"href":"http:\/\/www.jasonbailey.net\/stuff\/wp-json\/wp\/v2\/posts\/144\/revisions"}],"predecessor-version":[{"id":153,"href":"http:\/\/www.jasonbailey.net\/stuff\/wp-json\/wp\/v2\/posts\/144\/revisions\/153"}],"wp:attachment":[{"href":"http:\/\/www.jasonbailey.net\/stuff\/wp-json\/wp\/v2\/media?parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jasonbailey.net\/stuff\/wp-json\/wp\/v2\/categories?post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jasonbailey.net\/stuff\/wp-json\/wp\/v2\/tags?post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}