-
Notifications
You must be signed in to change notification settings - Fork 62
Account
An account is usually but not always associated with a single website. It will often contain multiple web properties (different parts of your website that you've configured Google Analytics to analyze separately, or simply the default web property that every website has in Google Analytics), which in turn will have one or more profiles.
You should navigate to a profile to run queries.
import googleanalytics as ga
accounts = ga.authenticate()
profile = accounts['debrouwere.org'].webproperties['UA-12933299-1'].profiles['debrouwere.org']
report = profile.core.query('pageviews').range('2014-10-01', '2014-10-31').get()
print(report['pageviews'])
L.append(object) -- append object to end
L.count(value) -> integer -- return number of occurrences of value
L.extend(iterable) -- extend list by appending elements from the iterable
L.insert(index, object) -- insert object before index
L.pop([index]) -> item -- remove and return item at index (default last). Raises IndexError if list is empty or index is out of range.
L.remove(value) -- remove first occurrence of value. Raises ValueError if the value is not present.
L.reverse() -- reverse IN PLACE
Greedy serialization requires the value to either be a column or convertible to a column, whereas non-greedy serialization will pass through any string as-is and will only serialize Column objects.
Non-greedy serialization is useful when preparing queries with custom filters or segments.
L.sort(cmp=None, key=None, reverse=False) -- stable sort IN PLACE; cmp(x, y) -> -1, 0, 1
A profile is a particular analytics configuration of a web property.
Each profile belongs to a web property and an account. As all
queries using the Google Analytics API run against a particular
profile, queries can only be created from a Profile
object.
profile.query('pageviews').range('2014-01-01', days=7).get()
L.append(object) -- append object to end
L.count(value) -> integer -- return number of occurrences of value
L.extend(iterable) -- extend list by appending elements from the iterable
L.insert(index, object) -- insert object before index
L.pop([index]) -> item -- remove and return item at index (default last). Raises IndexError if list is empty or index is out of range.
L.remove(value) -- remove first occurrence of value. Raises ValueError if the value is not present.
L.reverse() -- reverse IN PLACE
Greedy serialization requires the value to either be a column or convertible to a column, whereas non-greedy serialization will pass through any string as-is and will only serialize Column objects.
Non-greedy serialization is useful when preparing queries with custom filters or segments.
L.sort(cmp=None, key=None, reverse=False) -- stable sort IN PLACE; cmp(x, y) -> -1, 0, 1
A web property is a particular website you're tracking in Google Analytics. It has one or more profiles, and you will need to pick one from which to launch your queries.
A shortcut to the first profile of this webproperty.
- Authentication
- Querying
- Common Queries
- Working With Reports
- On The Command Line
- Python API documentation