Metrics and dimensions

I have never learned anything about web analytics before. This year, my submission to Google Summer of Code for a Drupal module (Google Analytics API) that makes use of the recently-released Google Analytics Data Export API was accepted. I have been doing a lot of reading about the vocabulary used, the methods of filtering data, etc.

One distinction that is crucial to understand in querying the Google servers for analytics data is the difference between metrics and dimensions.

Metrics are the actual hard pieces of tangible statistics themselves. These can include, for example:

Dimensions are the ways one can limit the scope of the metrics returned. Ways of doing this can include:

In practice

Without dimensions, you get the overall statistic for the entirety of your site. But when queried in conjunction with dimensions, you can get some interesting data.

For example: Give the number of page views with respect to different countries.

Or, in Google parlance: Select the ga:pageviews metric in conjunction with the ga:country dimension, giving something that looks like this, which in actual fact looks much like an SQL query result:

CountryPage Views
Algeria14
Belgium39
Canada49

The possibilities are boundless (okay, they are bounded by dimensions), and I am sure there will be many practical applications in Drupal.