GoogleAnalytics

=GoogleAnalytics(
string id,
string metrics,
string startDate,
string endDate,
[string dimensions,
string segment,
string filter,
string sort,
integer startIndex,
integer maxResults,
bool excludeHeaderInResult,
bool excludeDimensionsInResult]) : {string}

Using this function you can basically access any data from your Google Analytics account. This function an implementation of Google Analytics Data Feed Query Explorer in Excel.

Wizard

Building formulas with =GoogleAnalytics(…) can be a bit tricky. Because of this SeoTools has a Google Analytics Wizard that you can access from the SeoTools bar.

The wizard analyses your account and helps you build queries to include your Goals, Custom variables and Dynamic segments.

Function parameters

Id
String
The table id of the profile to request data from.
Read Google documentation.

Metrics
String
The metrics data to be retrieved from the. A single request is limited to a maximum of 10 metrics. Multiple metrics are submitted as a comma separated list.
Example: ga:visits,ga:bounces
Read Google documentation.

StartDate
String (or Excel date)
Beginning date to retrieve data in format YYYY-MM-DD.
Read Google documentation.

EndDate
String (or Excel date)
Final date to retrieve data in format YYYY-MM-DD.
Read Google documentation.

Dimensions
String (optional)
The dimension data to be retrieved. A single request is limited to a maximum of 7 dimensions. Multiple dimensions are submitted as a comma separated list.
Example:dimensions=ga:source,ga:medium
Read Google documentation.

Segment
String (optional)
Specifies a subset of visits based on either an expression or a filter. The subset of visits matched happens before dimensions and metrics are calculated.
Example:segment=gaid::10
Read Google documentation.

Filter
String (optional)
Specifies a subset of all data matched in analytics.
Example:ga:country==United%20States;ga:browser==Firefox
Read Google documentation.

Sort
String (optional)
The order and direction to retrieve the results. Can have multiple dimensions and metrics.
Example:sort=-ga:pageviews,ga:browser
Read Google documentation.

StartIndex
Int (optional; default 1)
Use this parameter to request more rows from the API. For example if your query matches 100,000 rows, the API will only return a subset of them and you can use this parameter to request different subsets.
Read Google documentation.

MaxResults
Int (optional; default 1000)
Maximum number of results to retrieve. The default is 1,000 but can be set up to 10,000.
Read Google documentation.

ExcludeHeaderInResult
TRUE or FALSE
Exclude headers from result.

ExcludeDimensionsInResult
TRUE or FALSE
Exclude dimensions from result.

Read about Google’s quota policy.

Tip: Use Dump for displaying results.

Authentication

Normally you login to Google Analytics in each session.

You can also store your default authentication for Google Analytics in SeoTools.config.xml in the   <GoogleAnalytics Username=”" Password=”"/> section if you don’t want to authenticate for every session.

Get help with this function in the SeoTools Community Forum.

 

One Response to GoogleAnalytics

  1. Gerry says:

    Unfortunately the links to Google appear to be broken I think this is the right link for most of them – http://code.google.com/apis/analytics/docs/gdata/v2/gdataReferenceDataFeed.html#endDate