Alright, after much mucking about with licensing issues and contacting library owners and further code merging and committing, it looks like we are back on track. Late night hacking has resulted in the following features:
- An administration page where you can log into a Google Account via AuthSub
- A testing query page where you can see what data Analytics will send back
According to the wiki schedule, all that needs doing before midterms is starting to figure out a GUI. I was also thinking it would be neat to attach data directly to nodes through hook_nodeapi(). So here is what I am thinking:
- Attach statistics data to each node either directly (slow) or through an object which lazily loads said statistics (faster).
- Create a tab beside "View" and "Edit" on nodes (not sure how to do this yet) that allow you to view said statistics.
- And for later on in the project: A dashboard page that aggregates some overall interesting statistics of the site.
Of course these bring up some questions which I would like to ask to you, the community:
- Which statistics should be included/attached to each node by default? The options are available here (see Metrics section). Note that some Metrics cannot be retrieved in conjunction with one another (it gets confusing).
- How do we reasonably detect which node is attached to which URLs? When GA returns URLs like:
pagePath: pageviews
/index.php: 159732
/portfolio: 41146
/services: 18763
/about: 17860
/portfolio_linkatech.php: 17330
/contact: 12881
/blog: 12176
/vancouver_web_design.php: 11732
/services.php: 8621
/portfolio?page=1: 8368(notice the older .php files from a previous non-Drupal site) -- how do we decide which node gets which pagePaths? The most straightforward solution I could think of was to take the statistic of the /node/xxx path, the statistics of any paths matching all path aliases pointing to that node, the statistics of above paths with any ?get=variables, and add them all up. Any other ideas?
- Same idea -- what analytics data should be available in the node's "Statistics" tab?
Testing
I would love to start getting some people to test out the module and send feedback/flames/comments my way. It's the first major Drupal module I have developed from scratch, so if you see things that are done a little strangely, feel free to point out a better way. I haven't released any versions yet so you'll need to check it out via everyone's favourite source control program:
cvs -z6 -d:pserver:anonymous:anonymous@cvs.drupal.org:/cvs/drupal-contrib checkout -d google_analytics_api-HEAD google_analytics_api/
Please take a look! It'll be most meaningful if you have a Google Analytics profile with a decent amount of pre-existing traffic on it.
But overall, so far so good. I am looking forward to the second half of this coding term. Thanks to everyone for sending emails with your interest in the project!
