|
||||||||
FRAMES NO FRAMES |
Google Analytics
Working with the Google Analytics Reporting API
The panel for specifying a Google Analytics data source
Google Analytics (see http://www.google.com/analytics/) is a mechanism for tracking the usage statistics and typical browsing paths of web sites and web shops offered by Google Inc.. The basic service is free, only high-volume usage is charged.
Two actions must be taken in order to use Google Analytics for a web site. First, on http://www.google.com/analytics/ an account must be created in which the domains and sub-domains to be tracked are specified. Second, each web page whose usage is to be tracked must be equipped with a little script which sends tracking information to the Google Analytics database each time the web page is opened. An explanation and step-by-step instructions can be found at http://www.google.com/analytics/discover_analytics.html.
Within a Google Analytics account one can define one or more 'web properties' and within each web property one or more 'profiles'. A web property can be regarded as a group of interrelated analytics tasks and each profile as one single analytics task. By inserting the little tracking scripts into the single web pages one defines which web page will send usage information to which profile.
For Evaluating the collected results, Google Analytics provides both a browser-based graphical frontend and an application programming interface (API) via which the collected data of a profile can be read into a third party program. This API is used by Synop Analyzer for reading the Google Analytics data of a web site into the software and for interactively exploring them.
In order to be able to access a web site's collected Google Analytics data, the owner of the Google Analytics account has to make sure the Analytics API service is enabled. To that purpose, log into the API administration console https://code.google.com/apis/console/, click on the menu item
Next, you have to create at least one access client within the API administration console. A client is a predefined access path for external programs which grants access to the collected data of one or more profiles within a Google analytics account.
To create a new access client, click on the menu item
When you later try to connect to the Google Analytics API, you must have these three values (client ID, client secret and redirect URL) at hand.
In addition, you must specify the 8-digit ID of one of the predefined profiles within the Google Analytics account. You can step through all available profile IDs by logging into your accoutn at https://www.google.com/analytics/web/ and by then clicking on the menu item on the upper left corner of the screen. This menu item opens a drop-down list of all profiles within the active Google Analytics account. A mouse-click on one of the rows of this drow-down list makes the account ID, web property ID and profile ID of that entry appear in the URL address line in your web browser. The profile ID is the series of 8 digits at the very end of the displayed URL, right after the letter 'p'.
These 8 digits (in the picture below they start with 55...) must also be at hand when you try to read Google Analytics data from Synop Analyzer.
From Synop Analyzer, you access a Google Analytics data source by clicking
In the panel fields ga:[Name]
. A list of all supported dimension and metrics name can be found at http://code.google.com/intl/de-DE/apis/analytics/docs/gdata/dimsmets/dimsmets.html. The specifications performed in the screenshot above specify that the retrieved data has the four columns ga:source
(web domain, from which the visitor came to our tracked web site), ga:medium
(type of the web site from which the visitor came to our web site), ga:visits
(number of visits to our tracked web site) and ga:pageviews
(number of clicked web pages).
You can memorize frequently used client IDs, client secrets, profile IDs, active dimensions and active metrics in the preference settings at
And one more step has to be done befor the data transfer can succeede: an authorization code must be created and entered into the last input field of Synop Analyzer's Google Analytics API specification panel. You generate an authorization code by pressing the button
Once all input fields of the panel have been filled correcty, pressing the button
Note that the authorization code is not reusable: you have to create and fill in a new authorization code each time you want to read data from the API.