Google Analytics API
  1. data
Google Analytics API
  • data
    • /data/ga
      GET
    • /data/mcf
      GET
    • /data/realtime
      GET
  • management
    • /management/accountSummaries
      GET
    • /management/accounts
      GET
    • /management/accounts/{accountId}/entityUserLinks
      GET
    • /management/accounts/{accountId}/entityUserLinks
      POST
    • /management/accounts/{accountId}/entityUserLinks/{linkId}
      DELETE
    • /management/accounts/{accountId}/entityUserLinks/{linkId}
      PUT
    • /management/accounts/{accountId}/filters
      GET
    • /management/accounts/{accountId}/filters
      POST
    • /management/accounts/{accountId}/filters/{filterId}
      DELETE
    • /management/accounts/{accountId}/filters/{filterId}
      GET
    • /management/accounts/{accountId}/filters/{filterId}
      PATCH
    • /management/accounts/{accountId}/filters/{filterId}
      PUT
    • /management/accounts/{accountId}/webproperties
      GET
    • /management/accounts/{accountId}/webproperties
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/uploads/{uploadId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/customMetrics/{customMetricId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/experiments/{experimentId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}
      PUT
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences
      POST
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}
      DELETE
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}
      GET
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}
      PATCH
    • /management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}
      PUT
    • /management/clientId:hashClientId
      POST
    • /management/segments
      GET
  • metadata
    • /metadata/{reportType}/columns
  • provisioning
    • /provisioning/createAccountTicket
    • /provisioning/createAccountTree
  • userDeletion
    • /userDeletion/userDeletionRequests:upsert
  1. data

/data/ga

GET
/data/ga
data
Returns Analytics data for a view (profile).
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://analytics.googleapis.com/analytics/v3/data/ga?ids=&start-date=&end-date=&metrics='
Response Response Example
{
  "columnHeaders": [
    {
      "columnType": "string",
      "dataType": "string",
      "name": "string"
    }
  ],
  "containsSampledData": true,
  "dataLastRefreshed": "string",
  "dataTable": {
    "cols": [
      {
        "id": "string",
        "label": "string",
        "type": "string"
      }
    ],
    "rows": [
      {
        "c": [
          {
            "v": "string"
          }
        ]
      }
    ]
  },
  "id": "string",
  "itemsPerPage": 0,
  "kind": "analytics#gaData",
  "nextLink": "string",
  "previousLink": "string",
  "profileInfo": {
    "accountId": "string",
    "internalWebPropertyId": "string",
    "profileId": "string",
    "profileName": "string",
    "tableId": "string",
    "webPropertyId": "string"
  },
  "query": {
    "dimensions": "string",
    "end-date": "string",
    "filters": "string",
    "ids": "string",
    "max-results": 0,
    "metrics": [
      "string"
    ],
    "samplingLevel": "string",
    "segment": "string",
    "sort": [
      "string"
    ],
    "start-date": "string",
    "start-index": 0
  },
  "rows": [
    [
      "string"
    ]
  ],
  "sampleSize": "string",
  "sampleSpace": "string",
  "selfLink": "string",
  "totalResults": 0,
  "totalsForAllResults": {
    "property1": "string",
    "property2": "string"
  }
}

Request

Query Params
ids
string 
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-date
string 
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-date
string 
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.
metrics
string 
required
A comma-separated list of Analytics metrics. E.g., 'ga:sessions,ga:pageviews'. At least one metric must be specified.
dimensions
string 
optional
A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.
filters
string 
optional
A comma-separated list of dimension or metric filters to be applied to Analytics data.
include-empty-rows
string 
optional
The response will include empty rows if this parameter is set to true, the default is true
max-results
integer 
optional
The maximum number of entries to include in this feed.
output
string 
optional
The selected format for the response. Default format is JSON.
samplingLevel
string 
optional
The desired sampling level.
segment
string 
optional
An Analytics segment to be applied to data.
sort
string 
optional
A comma-separated list of dimensions or metrics that determine the sort order for Analytics data.
start-index
integer 
optional
An index of the first entity to retrieve. Use this parameter as a pagination mechanism along with the max-results parameter.

Responses

🟢200Successful response
application/json
Body
Analytics data for a given view (profile).
columnHeaders
array [object {3}] 
optional
Column headers that list dimension names followed by the metric names. The order of dimensions and metrics is same as specified in the request.
columnType
string 
optional
Column Type. Either DIMENSION or METRIC.
dataType
string 
optional
Data type. Dimension column headers have only STRING as the data type. Metric column headers have data types for metric values such as INTEGER, DOUBLE, CURRENCY etc.
name
string 
optional
Column name.
containsSampledData
boolean 
optional
Determines if Analytics data contains samples.
dataLastRefreshed
string <int64>
optional
The last refreshed time in seconds for Analytics data.
dataTable
object 
optional
cols
array [object {3}] 
optional
rows
array [object {1}] 
optional
id
string 
optional
Unique ID for this data response.
itemsPerPage
integer <int32>
optional
The maximum number of rows the response can contain, regardless of the actual number of rows returned. Its value ranges from 1 to 10,000 with a value of 1000 by default, or otherwise specified by the max-results query parameter.
kind
string 
optional
Resource type.
Default:
analytics#gaData
nextLink
string 
optional
Link to next page for this Analytics data query.
previousLink
string 
optional
Link to previous page for this Analytics data query.
profileInfo
object 
optional
Information for the view (profile), for which the Analytics data was requested.
accountId
string 
optional
Account ID to which this view (profile) belongs.
internalWebPropertyId
string 
optional
Internal ID for the web property to which this view (profile) belongs.
profileId
string 
optional
View (Profile) ID.
profileName
string 
optional
View (Profile) name.
tableId
string 
optional
Table ID for view (profile).
webPropertyId
string 
optional
Web Property ID to which this view (profile) belongs.
query
object 
optional
Analytics data request query parameters.
dimensions
string 
optional
List of analytics dimensions.
end-date
string 
optional
End date.
filters
string 
optional
Comma-separated list of dimension or metric filters.
ids
string 
optional
Unique table ID.
max-results
integer <int32>
optional
Maximum results per page.
metrics
array[string]
optional
List of analytics metrics.
samplingLevel
string 
optional
Desired sampling level
segment
string 
optional
Analytics advanced segment.
sort
array[string]
optional
List of dimensions or metrics based on which Analytics data is sorted.
start-date
string 
optional
Start date.
start-index
integer <int32>
optional
Start index.
rows
array [array] 
optional
Analytics data rows, where each row contains a list of dimension values followed by the metric values. The order of dimensions and metrics is same as specified in the request.
string 
optional
sampleSize
string <int64>
optional
The number of samples used to calculate the result.
sampleSpace
string <int64>
optional
Total size of the sample space from which the samples were selected.
selfLink
string 
optional
Link to this page.
totalResults
integer <int32>
optional
The total number of rows for the query, regardless of the number of rows in the response.
totalsForAllResults
object 
optional
Total values for the requested metrics over all the results, not just the results returned in this response. The order of the metric totals is same as the metric order specified in the request.
Additional properties
string 
optional
Key-value pair for the total value of a metric. Key is the metric name and the value is the total value for that metric.
Modified at 2023-08-15 05:39:07
Next
/data/mcf
Built with