Abstract
This module will integrate with the upcoming Google Analytics API. It will connect on the server-side to the Google Analytics server either periodically or on request, and format data in an interesting an accessible way to the Drupal website administrator.
Overview
It is a standard practice to include a Google Analytics code in any Drupal website so that clients have a better understanding of how their site is being used, found, and ranked. However the Analytics site itself is separate and has perhaps more information than a non-poweruser might find useful. Let's take this a step further and integrate Google Analytics into the Drupal website itself.
Description
This module would expose a new area in the Drupal administration section where users would be able to view various real-time or cached statistics on how the site is being accessed and used. Two methods or possibly a combination thereof could be used to gather this data through the Google Analytics API:
1. access the Google Analytics server every time the user reloads the administration page in their Drupal site
2. cache the information when the user accesses this page, or through a cron job that could be run on a customizable interval
The stages of developing this module would be approximately as follows:
- Obtain permission from Google to develop for this API while it is still in beta: http://code.google.com/apis/analytics/docs/tracking/trustedTester.html
- Develop a lightweight API on the Drupal side to allow for other Drupal modules to access the Google Analytics data
- Develop a module on top of this API that displays information in a meaningful and useful way.
Future directions might include integrating Analytics data into other aspects of Drupal. For example, nodes might be able to tell which keywords they contain that are receiving the most hits. Those terms could be intelligently adapted to be linked to other pages, or highlighted to the user. Many different possibilities exist in this area.
Mentors
* Rick Vugteveen: a local mentor who works near the student
Difficulty
Medium to hard
Comments
Good luck
Glad to see that this is going to happen, good luck to Joel!
Thanks, Robert. It should
Thanks, Robert. It should be a lot of fun!
Enablers for significantly new functionality
Great to know that it is going to happen. I was dreaming about it for months. Just imagine the indirect possibilities: blocks and views of "lately popular" content, ordering views by "most popular of facebook", auto-showing the digg/reddit/etc icon only if node gathered a given number of visitors from digg/reddit/etc.
I hope the API will be generic enough to allow using the "statistical node properties" in views, blocks, etc.
Planning
Hi Artem,
Good to hear that there is support and interest. We are about to enter the planning phase of the GSoC period, so it would be great to hear any additional thoughts you have about the direction of the project. I definitely recognize the power in having a generic enough Drupal-side API, and I am confident that Dmitri and I will be able to hash out something flexible enough.
Joel
Definitely would be cool
To create views associated with analytics data. Most popular content of a specific node type within x number of days, etc, creating variables to allow all kinds of specificity in the views. Excited to see where this goes!
-Mordecai
Advomatic
Drupal Development, Drupal Maintenance and Drupal Hosting
Advomatic
Drupal Development, Drupal Maintenance and Drupal Hosting
Project Update
Hello all,
I just wanted to give an update as to how the project is going to date. Here's how it progressed since the start of the GSoC term:
I found an existing PHP library called Google Analytics API PHP Interface (GAPI) that had support to access the Google Analytics Data Export API, but it lacked AuthSub support, which is arguably one of the more flexible authentication methods to access Google Services. Thus I spent time looking into the auth documentation, and hacked in support to the library. I started tracking my changes into the Drupal.org CVS repository.
Unfortunately, I soon found out from my mentor the unfortunate news that the library's license was incompatible with that of Drupal's and therefore was not allowed in the repository. I contacted the owner of the GAPI library (Stig Manning) and luckily he was glad to let me merge my changes back into the library's repository on Google Code, and in addition he had no problem re-licensing it so that it could be packaged with the Drupal module.
At this point I am working on merging the changes back into the GAPI repository, and from there I will be writing the low-level Drupal code, such as an admin area for administering the current AuthSub authentication, and the main function used to fetch data from Google Analytics. The Google Summer of Code midterm evaluations deadline is July 13, and I expect to have the above completed by then and to move onto making use of the data in Drupal (e.g. a dashboard for showing statistics, attaching information to each node for use with Views).
I am maintaining a blog (jkweb.ca) that you can visit for updates or information on the project (a list of relevant links is in the sidebar).
Artem and Mordecai: My mentor and I decided to refocus the project a bit to put an emphasis on attaching statistical data to nodes, and I think this will address your wishes above. Perhaps if you like I could contact you when I get to that point and I would be able to receive some testing from your end?
Thank you for all your support thus far!
Joel
btw, your blog is broken --
btw, your blog is broken -- the home page works but the links point to something like this: http://localhost:8080/index?_s=J9X-MyiRhw3NmGEi&_k=ceXC_E5e&2
Kyle Mathews
Kyle Mathews
Broken Blog
Hi Kyle,
Thanks for pointing that out. I have fixed this issue, but it looks like there are a few more small bugs I should get to soon...
Joel