Parameters
  • 29 Mar 2024
  • 3 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Parameters

  • Dark
    Light
  • PDF

Article summary

End period

Use the end_period parameter to specify the ending day of a date range. You must also supply the start_period.

end_period = ending day of date range

Example: specifying January 1, 2024 to January 30, 2024

start_period=2024m01d01&end_period=2024m01d30

Example: specifying the past 7 days (from yesterday)

start_period=current_day-7&end_period=current_day-1

Note: Several time period macros are available: CURRENT_DAY, CURRENT_MONTH and CURRENT_YEAR. Instead of a specific start and end date, you can identify relative time periods.

Format

format = return data format

Data formatParameter and value
JSONformat=json
XMLformat=xml
XML2 ("XPath-friendly" XML for dynamic applications)format=xml2
HTMLformat=html (use this when importing data into Excel)
CSVformat=csv (returned as a download)
RSSformat=rss (use to specify an RSS 2.0 syndication feed)
ATOMformat=atom (use to specify an ATOM 1.0 syndication feed)

For report data requests, all formats are supported. For "list" requests, only XML and JSON formats are supported.

HTTP Status Codes

Status codes returned by the service.

401 Authorization was refused for that user/account and password.
403 Forbidden. The request was valid, but the server is refusing to respond, possibly because a rate limit has been exceeded.
404 The resource you requested was not found.
408 The request timed out.
503 Service unavailable.

Language

Use the language parameter with a language ID, such as en or locale ID, such as en-GB to specify language and locale preferences for translating and formatting dates and numbers in report data. (See ISO 639-1 and ISO-3166 for codes.)

The languages available are those that appear in the Analytics user interface as preferences.

language = language code[-dialect designator]

Strictly speaking, language=en_GB is a locale identifier for English-language speakers in Great Britain. (A hyphen is used to designate a dialect of a language, so the dialect for a resident of Great Britain is en-GB). In practice, however, due to the widespread lack of understanding of this distinction, "-" and "_" are treated as equivalent.

Measures

Use the measures parameter to specify the measures to return. If you do not use this parameter, all measures are returned.

measures = measure1 * measure2 * ...
Example: returning only visits and visitors

measures=visits*visitors

Period

Use the period parameter to specify the time period of interest and a trend length for report data. You can specify a relative time span or a specific time span (see here). Supplying only period is the same as supplying start_period and end_period with the same value.

period = time period * trend length

Example: getting data for a relative time period (current_day, current_month, current_year)

Time spanParameter and value
Yesterdayperiod=current_day-1
Two months agoperiod=current_month-2
Trending backward from February 28period=2024m02d28*28
Rolling 7-days-to-date trendperiod=current_day-1*7
Year trend with holidays and annual cyclical dataperiod=current_month-1*12

Range

Use the range parameter to specify the start and end rows of the range of rows to return. If you specify only end row, start row defaults to 1. If you do not use this parameter, all rows are returned.

Note: The range parameter cannot be used in drill-down reports, since they contain a hierarchy of ranges.

range = start row * end row

Example: specifying ranges

RangeParameter and value
First 100 rowsrange=100
Rows 101 to 200range=101*200

Search

Use the search parameter for reports to return only records containing the search string in their dimension value.

search = search string

Example: creating a report with only the rows whose dimension value contains "DVD": search=DVD

Start period

Use the start_period parameter to specify the beginning day of a date range. You must also supply the end_period.

start_period = first day of date range

Example: specifying January 1, 2024 to January 30, 2024

start_period=2024m01d01&end_period=2024m01d30

Example: specifying the past 7 days (from yesterday)

start_period=current_day-7&end_period=current_day-1

Suppress error codes

Set the suppress_error_codes parameter to true if you do not want to be notified of error conditions for a request (the default is false).

suppress_error_codes = {true|false}
Example: Suppress errors for a request
suppress_error_codes=true

Totals

The totals parameter specifies whether, or how, totals for measures are returned: all (default), only or none.

totals = {all | only | none}

Note: If you use the range or search parameter to return a subset of data, the totals returned are the subtotals for the entire period, rollup dimension, etc. For subsets of data, specify totals=none and use Excel to compute the totals.

What to returnParameter and value
No totalstotals=none
All totals (the default)totals=all
Only totalstotals=only

Was this article helpful?