Just when I get quite familiar with SQL statements once again, when pulling data from Google Analytics, I found that they don't use SQL, but rather, use Dimensions and Metrics and the combinations of them.
Why is a reason for that? I think it doesn't have a SQL interface (or a plain web server log download)? If so, how do SQL statements translate to Dimension, Metrics (and Segment and Filters)?
It seems that Metrics tend to be the "aggregates" such as count() or average(), and Dimension tends to be the logged values themselves (such as Browser == IE or Country == Australia), which is the same as the group by
values. Filters is like conditionals, and what about Segment?
It seems that if we specify Dimensions, then it automatically does a group by
and display that field as well. It does count() or sum() usually. What if we want average(*)
instead? And what if we want it to show but don't want it to do a group by
?
example website to experiment is at http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html
Dimensions are attributes of your data. For example, the dimension City indicates the city, for example, "Paris" or "New York", from which a session originates. The dimension Page indicates the URL of a page that is viewed. Metrics are quantitative measurements.
Google Analytics enables users to track up to 200 different metrics to measure how their websites are performing. While some metrics may be more valuable to certain businesses than others, these are some of the most popular metrics: Users. A user is a unique or new visitor to the website.
Google Analytics is a platform that collects data from your websites and apps to create reports that provide insights into your business.
Google Analytics and SQL: A Powerful Combo Google Analytics is a powerful tool. However, you can also export information from GA to create SQL reports that will give you even more insight into your data. And if you've analyzed this article well, you already know that learning SQL will pay off for sure.
use of the terms "Dimensions" and "Metrics" suggests that Google are using an OLAP database rather than a relational database.... SQL is used for relational databases: OLAP uses MDX or proprietary query languages (if Oracle).
From http://en.wikipedia.org/wiki/OLAP
The core of any OLAP system is an OLAP cube (also called a 'multidimensional cube' or a hypercube).
It consists of numeric facts called measures which are categorized by dimensions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With