analytics.data.ga.get

GET {{baseUrl}}/data/ga?ids=<string>&start-date=<string>&end-date=<string>&metrics=<string>&dimensions=<string>&filters=<string>&include-empty-rows=<boolean>&max-results=<integer>&output=<string>&samplingLevel=<string>&segment=<string>&sort=<string>&start-index=<integer>&alt=<string>&fields=<string>&key=<string>&oauth_token=<string>&prettyPrint=<boolean>&quotaUser=<string>&userIp=<string>

Returns Analytics data for a view (profile).

Request Params

KeyDatatypeRequiredDescription
idsstring(Required) Unique table ID for retrieving Analytics data. Table ID is of the form ga:XXXX, where XXXX is the Analytics view (profile) ID.
start-datestring(Required) Start date for fetching Analytics data. Requests can specify a start date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is 7daysAgo.
end-datestring(Required) End date for fetching Analytics data. Request can should specify an end date formatted as YYYY-MM-DD, or as a relative date (e.g., today, yesterday, or 7daysAgo). The default value is yesterday.
metricsstring(Required) A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified.
dimensionsstringA comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.
filtersstringA comma-separated list of dimension or metric filters to be applied to Analytics data.
include-empty-rowsstringThe response will include empty rows if this parameter is set to true, the default is true
max-resultsstringThe maximum number of entries to include in this feed.
outputstringThe selected format for the response. Default format is JSON.
samplingLevelstringThe desired sampling level.
segmentstringAn Analytics segment to be applied to data.
sortstringA comma-separated list of dimensions or metrics that determine the sort order for Analytics data.
start-indexstringAn index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.
altstringData format for the response.
fieldsstringSelector specifying which fields to include in a partial response.
keystringAPI key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
oauth_tokenstringOAuth 2.0 token for the current user.
prettyPrintstringReturns response with indentations and line breaks.
quotaUserstringAn opaque string that represents a user for quota purposes. Must not exceed 40 characters.
userIpstringDeprecated. Please use quotaUser instead.

RESPONSES

status: OK

{&quot;columnHeaders&quot;:[{&quot;columnType&quot;:&quot;aute consect&quot;,&quot;dataType&quot;:&quot;ea aliquip dolor reprehenderit dolore&quot;,&quot;name&quot;:&quot;non officia&quot;},{&quot;columnType&quot;:&quot;non velit esse aute elit&quot;,&quot;dataType&quot;:&quot;aliqua nulla&quot;,&quot;name&quot;:&quot;in in&quot;}],&quot;containsSampledData&quot;:false,&quot;dataLastRefreshed&quot;:&quot;Ut reprehenderit in&quot;,&quot;dataTable&quot;:{&quot;cols&quot;:[{&quot;id&quot;:&quot;minim ut Duis aliqua velit&quot;,&quot;label&quot;:&quot;adipisicing deserunt&quot;,&quot;type&quot;:&quot;ut reprehenderit minim ea esse&quot;},{&quot;id&quot;:&quot;occaecat dol&quot;,&quot;label&quot;:&quot;ea&quot;,&quot;type&quot;:&quot;officia deserunt&quot;}],&quot;rows&quot;:[{&quot;c&quot;:[{&quot;v&quot;:&quot;in aliquip&quot;},{&quot;v&quot;:&quot;fugiat dolor consectetur proide&quot;}]},{&quot;c&quot;:[{&quot;v&quot;:&quot;dolore&quot;},{&quot;v&quot;:&quot;amet qui ad dolor&quot;}]}]},&quot;id&quot;:&quot;sed in Duis&quot;,&quot;itemsPerPage&quot;:-17456361,&quot;kind&quot;:&quot;analytics#gaData&quot;,&quot;nextLink&quot;:&quot;exercitation&quot;,&quot;previousLink&quot;:&quot;nulla id dolor sint&quot;,&quot;profileInfo&quot;:{&quot;accountId&quot;:&quot;est aute exercitation irure&quot;,&quot;internalWebPropertyId&quot;:&quot;ipsum&quot;,&quot;profileId&quot;:&quot;veniam eiusmod Lorem&quot;,&quot;profileName&quot;:&quot;nisi laboris incididunt mollit&quot;,&quot;tableId&quot;:&quot;anim pariatur nisi exercitation officia&quot;,&quot;webPropertyId&quot;:&quot;laborum adipisicing&quot;},&quot;query&quot;:{&quot;dimensions&quot;:&quot;in eiusmod dolor laborum&quot;,&quot;end-date&quot;:&quot;quis aliquip velit Duis&quot;,&quot;filters&quot;:&quot;tempor cillum deserunt&quot;,&quot;ids&quot;:&quot;mollit reprehenderit nisi&quot;,&quot;max-results&quot;:-48164987,&quot;metrics&quot;:[&quot;aliqua amet nostrud&quot;,&quot;esse consectetur dolore&quot;],&quot;samplingLevel&quot;:&quot;et veniam eu&quot;,&quot;segment&quot;:&quot;anim &quot;,&quot;sort&quot;:[&quot;ut adipisicing consectetur eiusmod proident&quot;,&quot;proident aliqua consectetur nulla&quot;],&quot;start-date&quot;:&quot;non Lorem ex occaecat&quot;,&quot;start-index&quot;:-23612019},&quot;rows&quot;:[[&quot;cillum minim do sint&quot;,&quot;elit &quot;],[&quot;nostrud in adipisicing labore&quot;,&quot;deserunt&quot;]],&quot;sampleSize&quot;:&quot;anim pariatur dolore&quot;,&quot;sampleSpace&quot;:&quot;quis in tempor nisi&quot;,&quot;selfLink&quot;:&quot;cupidatat nostrud&quot;,&quot;totalResults&quot;:81794720,&quot;totalsForAllResults&quot;:{}}