Parameters
  • 12 Mar 2021
  • 5 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Parameters

  • Dark
    Light
  • PDF

end period

Use the end_period parameter to specify the ending day of a date range. You must also supply the beginning day. end_period is an optional parameter. If end_period is not supplied, the data returned will only be from the time specified by start_period. Supplying only start_period is the same as supplying start_period and end_period with the same value.

end_period = ending day of date range

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

start_period=2020m01d01&end_period=2020m01d30

Example: specifying the past 7 days (from yesterday)

start_period=current_day-7&end_period=current_day-1

Example: specifying hourly data for March 21, 2020

start_period=2020m03d20h00&end_period=2020m03d21h24

format

format = return data format
Example: specifying data formats

Data format Parameter and value
JSON format=json
XML format=xml
XML2 ("XPath-friendly" XML for dynamic applications) format=xml2
HTML format=html (use this when importing data into Excel)
CSV format=csv (available for account-level and profile-level keymetrics)
RSS format=rss (use to specify an RSS 2.0 syndication feed)
ATOM format=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 preference being selected in the Analytics user interface.
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 span of interest and a trend length for report data. You can specify a relative time span or a specific time span.

Note: Before you can get data on specific hours or trend data, intervals must be turned on in the profile or custom report. To turn on intervals in the profile, edit the profile, then select: Analysis > Resource Control > "Include interval data in all custom reports for this profile". Trend data is not available for weekly or quarterly time spans.

period = time span * trend length

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

Time span Parameter and value
Yesterday period=current_day-1
Two months ago period=current_month-2
Trending backward from February 28 period=2021m02d28*28
Rolling 7-days-to-date trend period=current_day-1*7
Year trend with holidays and annual cyclical data period=current_month-1*12

Example: getting data for a specific time span (year, quarter, month, week, day, hour)

Time span Parameter and value
2021 period=2021
First quarter of 2021 period=2021q01
January 2021 period=2021m01
January, February and March 2021 period=2021m03*3
23rd week of 2021 period=2021w23
January 1, 2021 period=2021m01d01
January 1, 2021 through January 6, 2021 period=2021m01d06*6
Noon on January 1, 2021 period=2021m01d01h12

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

Range Parameter and value
First 100 rows range=100
Rows 101 to 200 range=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

You can also use an advanced filtering string (for example, google.com+my.yahoo.com) from Analytics as a value, but operator characters in the string must be URL-encoded. See the URL Encoding Reference at: http://www.w3schools.com/TAGS/ref_urlencode.asp.

Example: using an advanced filtering string with the search parameter:

search=google.com%2Bmy.yahoo.com

start_period

Use the start_period parameter to specify the beginning day of a date range. end_period is an optional parameter. If end_period is not supplied, the data returned will only be from the time specified by start_period. Supplying only start_period is the same as supplying start_period and end_period with the same value.

start_period = first day of date range

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

start_period=2020m01d01&end_period=2020m01d30

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 return Parameter and value
No totals totals=none
All totals (the default) totals=all
Only totals totals=only

totalsonly

Set the totalsonly parameter to true to return only measure totals for the date range specified by the period parameter. This makes the report one dimensional (where period is the only dimension). The default value is false. This parameter is not supported for trending.

totalsonly = {true|false}
Example: return only totals

totalsonly=true

trend

Set the trend parameter to true to get trend data. Supported only for report data.

trend = {true|false}


Was this article helpful?