Posts Tagged ‘Analytics API’
API Python Client Library Updated
It’s easier for developers to program in the languages they know, so we updated the Google Analytics API Python Client library with the just-launched API version 2 features. We also added reference examples for both the Account Feed and Data Feed. Now it’s easier than ever to automate your analysis workflow using our API.
Taking The Library For a Spin
With the updated library, we thought it would be a great time to highlight the power of the new features. So we created a sample application to do just that. The application uses the new Python library to retrieve metrics for a series of segments. It then performs some calculations on the data and creates bar charts using the GChartWrapper package, an open source Python wrapper for the Google Charts API. Finally, it uses the Python Imaging Library to add a title and legend, and stitches all the charts together into a single image. We decided to release this application as open source so you can create visualizations with your own data.
Solving Business Problems
Since social media is all the rage, let’s use this new application to help Avinash Kaushik, our Analytics Evangelist, measure “engagement” on his popular Occam’s Razor blog. We also wanted to determine if the time he spends participating in social media sites is valuable and sends new readers to his blog.
First we created segments to pull all the referrals from Facebook and Twitter. Second, we chose five calculations and corresponding metrics to compare the performance of these two segments. We then compared the segments to each other and, for context, for all the visits to the site as a control.
They say a picture is worth a thousand words, here are the results:
Some interesting observations become apparent.
- Far more visits originate from Twitter (3.6x) when compared to Facebook, perhaps not surprising given Avinash’s Twitter followers (~16,120)
- Visitors from Twitter tend to be new visitors, a good thing, but they view fewer pages and spend significantly less time on the blog.
- On the other hand Facebook delivers an audience that is loyal. These visitors come back to the site more often and spend a significant time on the blog (compared to Twitter and all other visitors).
The bottom line? Even though social networking sites are all the rage, they actually contribute very little to Avinash’s blog. If this blog were a company, it would be wise to ensure the time and effort put into driving traffic from social media is proportionate to the actual volume of traffic and goal conversions from those sites.
Hopefully this example shows how powerful our new features can be.
If you’re interested in running this report against your own data, the application is free and open sourced. Additionally, we made it really easy to change the metrics, segments, calculations and all the other visual properties to power your own visualizations. Download it here and give it a whirl, we would love to hear your feedback.
Posted by Nick Mihailovski, The Google Analytics API Team
New Google Analytics API Features
Over the past few months we’ve received a lot of great feedback from our developers about what they wanted to see in the Google Analytics API, and it included adding access to Google Analytics newest and most powerful features, such as advanced segments, custom variables and more. Today we want to let you know about improvements to the Google Analytics Data Export API, including the following highlights (all the details of this release can be found on our public changelog and public notify group):
Support for Advanced Segments
With advanced segmentation, you can look beyond your aggregated data and peer into the nuances of traffic and visitor activity on your site. For example, the average time on site for all visits could be 60 seconds, but when you segment by country, you might learn that average time on site of visits from Germany is over 2 minutes.
We’ve added two new ways to use advanced segments through the API:
- Create them on the fly by specifying their expression directly through an API query.
- Use advanced segments created in the Google Analytics web interface through the API.
This video describes exactly what advanced segments do and how you can use them with the API.
Goal 5-20 and Configuration Data
With the recent Google Analytics launch enabling up to 20 goals, many of you asked for access to this valuable data. Good call! So now, you can access 48 new metrics around goal performance. We’ve also added all the goal configuration data, including name, type, and step names for each profile.
Take a look at this video describing how to work with goal configuration data in the API.
Custom Variables
Custom variables are powerful new ways to describe visitors, visits and pages within Google Analytics. In this new release, we’ve added 10 new dimensions to access custom variable data. In addition, every custom variable that you’ve used is now available through the Account Feed.
We’ve updated all our documentatation at http://code.google.com/apis/analytics. Please continue to give us feedback to improve our product through our public google group. We can’t wait to see the new apps that come from developers using this data. We’re hoping that you spend your holiday tinkering with it
Enjoy!
Posted by Nick Mihailovski, Google Analytics API Team
Depth and Discovery: Powering Visualizations with the Google Analytics API
Curious about what sites are linking to you and what content is benefitting the most? The Referrer Flow visualization answers those question and shows how results change over time. It’s a stream of daily treemaps showing pageviews and bounce rates for various groupings of your website’s pages. You can group by combinations of page title, referrer and url.
Referrer Flow
Clicking on the treemap will filter all the data by the page, referrer or url that you clicked on. Click again to clear your filter.
A list of top keywords isn’t enough to really understand how people are searching and finding your site. The Keyword Tree visualization displays the most frequently used search keywords and how they are used together. Here’s a video overview:
You’ll see a frequently used search term at the center and the words and phrases that are most often used in combination with that word. Pick a different starting word by typing into the box in the upper right or selecting from the top word across the bottom of the screen. The words are sized by their frequency of use and colored by bounce rate (or % new visitors or average time on site). Roll over a word to see details about that combination of connected words.
Posted by Nick Mihailovski, Google Analytics API Team
New Free Google Analytics API Dashboard Application
If you manage many Google Analytics profiles, it can be difficult to stay on top of all your top line metrics across accounts -until now. Trakkboard is a free, easy to use desktop application that allows analysts to create dashboards that pull data across different Google Analytics logins and different Google Analytics profiles to display top level metrics all within the same view.

This application was built using the Google Analytics API by our friends in Germany, Trakken GmbH and is available in English, German and Spanish. Once downloaded, you can add multiple Google Accounts, select Google Analytics Accounts and profiles, then choose from any of the pre-canned report widgets. The report widget will then appear on the dashboard. This process can be repeated with other Google Analytics Accounts, Profiles, and Widgets – and your customized dashboard is ready to use.

What’s really nice is each report widget can be configured to automatically fetch new data from the API at a regular interval, for example, every hour. This dramatically reduces the time it takes to see top level metrics across all your accounts.
- 15 different report widgets available
- Top/flop keywords widget (movers & shakers)
- Drag-drop and resize report widgets
- Update all widgets at the same time
- Update individual widgets at set intervals
- Use tabs for more dashboards
- Resize report widgets
- Notes widgets for comments
- Add up to two Google Account Email addresses
- FAQ Center available in English, Spanish, German
We continue to be impressed by the new solutions developers are bringing to market by leveraging the Google Analytics Platform. If you have developed a useful new tool or integration on top of Google Analytics, drop us an email at analytics-api@google.com. If it’s innovative and useful we’ll highlight it to our readers on this blog.
Posted by Nick Mihailovski, Google Analytics API Team
Google Analytics API on App Engine Treemap Visualization
Here is a captivating way to look at your Google Analytics data in a Treemap visualization. You can visualize your own data with our live demo. (Note: IE currently not supported for visualization part.)
And, here is a video explaining how to look at the Treemap visualization and how to use it.
The goal of this example was to teach people how to use the Google Analytics API on App Engine in Java, as well as to demonstrate how to use both OAuth and AuthSub along with the App Engine’s various services. The code looked great, but the output was a boring HTML table. So we used some open source tools to transform the table into a pretty tree map visualization, which is also useful in noticing interesting metrics.
All the code has been open sourced on Google Project hosting. Also, here’s an article describing how this application works making it easy for developers to use this example as a starting point for new data visualizations and other Google Data projects.
For the data retrieval part, we used the App Engine Java SDK and the Google Analytics Data Export API Java Client Library to retrieve data from Google Analytics. The example code implements both unsigned AuthSub and registered OAuth authorization methods allowing developers to get up and running quickly in their dev environment and later switch to a secure authorization method in production environments. The application also uses the Model-View-Controller pattern, making it flexible and allowing developers to extend the code for new applications (e.g. adding support for other Google Data APIs).
And lastly, for the visualization part, we used the open-sourced Protovis SVG Visualization Library to create the Treemap. This JavaScript library is maintained by the Stanford Visualization Group and excels at creating brand new visualizations from a data set (in this case a boring HTML table). To handle all of the interactions, including rollover, tooltips and slider controls, we used JQuery. Here is the JavaScript source for the visualization part of the sample.
Enjoy!
Posted by Nick Mihailovski, Google Analytics API Team
Overview Of The Google Analytics Platform And API
In the previous two videos from the API team, tech lead Jacob Matthews discussed What Is the Google Analytics API and Steps To Using the Google Analytics API.
In our third video, we turn to Ruth Doane, another Tech Lead, to take a step back and look under the hood of Google Analytics itself. Did you ever wonder how data is collected and organized in Google Analytics? See what happens to traffic data after it is sent to Google Analytics and learn how it gets processed and stored, and then ends up in the Web Interface and Custom Reporting.
New Video: Steps to Using the Analytics API
Last week, in our Google Analytics API video series, Jacob Matthews discussed What is the Google Analytics API? In this new video, Jacobs goes deeper and describes the three steps developers need to take to retrieve data from Google Analytics: Authentication, Account Query, and Profile/Report Query.
New Analytics API Features including Event Tracking!
We are excited to be releasing new features — features that have been prioritized based on feedback from you.
Event Tracking
Get Excited! Event Tracking, our number-one feature request, is available through the API. You can use event tracking to measure the number of user interactions with a website. For example, you can track:
- the total number of times a white paper is downloaded
- the length of time it takes to load a video
- the number of validation errors users get when filling out a form
If you already have an integration with Google Analytics, Event Tracking is even more exciting. To illustrate, let’s look at Sprout. Sprout’s integration with Google Analytics helps customers track user interaction within their Sprout content. However, users currently must log into the Sprout interface to see billing and account management data, and then also log into Google Analytics to see how their own sprouts are performing. Now that event tracking is available through the API, companies like Sprout can pull the interaction metrics tracked by Google Analytics events and present them directly in clients’ performance dashboards–effectively leveraging Google Analytics as a platform to power their analysis reports.
Ready to try out Event Tracking yourself? Check out the event tracking API docs, or fire up the Query Explorer tool.
Navigational data
The Google Analytics web interface provides a navigation report. Analysts use it to infer which links visitors click on, from one particular page to the next. Now that this data is available through the API, you can create new visualizations, such as custom site overlays, to see which links get the most clicks.
Increased filter length
The length of filter expressions has been increased to 128 characters. This enables developers to perform more complex queries with fewer requests to the API, saving bandwidth and quota.
There is a detailed list of all these changes in our public change log. We hope you find these features useful to your development and look forward to your comments and continued feedback. If you haven’t done so already, please join our public Google group and let us know how you’ve been using the API.
Posted by Nick Mihailovski, Google Analytics Team
New Video: What is the Analytics API?
I spent a day in Irvine, California interviewing some of the software engineers who built the Google Analytics API, starting with Jacob Matthews, the tech lead behind the API. If you haven’t read any of our API documentation yet but you have been wondering what the Google Analytics API is all about, we put together a couple of videos where we hear about the API from the people who built it. Here is the first one where we keep it high level and ask Jacob, “What is the Google Analytics API?”
Posted by Nick Mihailovski, The Google Analytics API Team


