You are here

How to Display Your Site Traffic Using the Google Analytics API

As we all know, there is value in data, and these days we can collect it from an almost-endless list of sources, the most prevalent being website analytics. While much emphasis is placed on the demographics and geographic location of site visitors, as well as the route they took to get to your site, the sheer volume of visitors is a valuable metric in many instances.

As an example, a website that generates revenue from advertising will place a large emphasis on exposing its traffic figures to prove the value it offers to potential advertisers, driving continued business. In this tutorial on dannyrb.com, the author guides followers through accessing their site data using Google Analytics API, and exposing that visually on their website.

The tutorial relies on Google’s Embedded API and Google’s PHP API Client Library, which needs a local PHP server to work well. Detailed instructions are provided for configuring the Developer Console and creating a Google Service Account for authenticated access to the data.

Queries are made by an embedded client-side API that receives an authentication token from the server-side library, the code for both sides is provided. Built-in functions then render charts to present the data, although this is a simplistic view. The author reminds us that this is simply a proof of concept post, and this implementation could benefit from visual and performance enhancements by users.

Be sure to read the next Analytics article: How to Consume the Google Analytics API Using Python

Original Article

How To Use Google Analytics' API To Share Your Traffic

 

Comments