バージョン 8.3.8

Back | 

WsGoogleAnalyticsReport

Returns Returns google analytics report for the given account

URL Format

/ws/ws_google_analytics_report/api/{app_token}/mode/json/apiv/5/?start-date={start-date}&end-date={end-date}&sort={sort}&dimensions={dimensions}&max-results={max-results}&metrics={metrics}

Parameters

Name Req Type Description
app_token string App token for the client
apiv integer The api version; only version 5 supported.
start-date string Start date for fetching Analytics data. All requests should specify a start date formatted as YYYY-MM-DD.
end-date string End date for fetching Analytics data. All requests should specify a end date formatted as YYYY-MM-DD.
sort string A comma-separated list of dimensions or metrics that determine the sort order for Analytics data. (eg -ga:sessions)
dimensions string A comma-separated list of Analytics dimensions. E.g., 'ga:browser,ga:city'.
max-results integer The maximum number of entries to include in this feed. (default set to 50)
metrics string A comma-separated list of Analytics metrics. E.g., 'ga:visits,ga:pageviews'. At least one metric must be specified.
filters string A comma-separated list of dimension or metric filters to be applied to Analytics data.

Request Headers

Name

Possible Responses

  • 886 Google Analytics report found
  • 659 Invalid Client
  • 102 Invalid app token
  • 916 Google Analytics account not found
  • 917 Invalid start-date
  • 918 Invalid end-date
  • 919 Invalid max-results
  • 920 Google Analytics exception
  • 921 Invalid metrics

Example Response

{
  "response": {
    "success": {
      "code": 886,
      "message": "Google Analytics report found",
      "details": ""
    },
    "WsGoogleAnalyticsResponse": {
      "report": {
        "kind": "analytics#gaData",
        "itemsPerPage": 15,
        "totalResults": 2,
        "totalsForAllResults": {
          "ga:sessions": "6"
        },
        "rows": [
          [
            "Windows",
            "4"
          ],
          [
            "iOS",
            "2"
          ]
        ]
      }
    }
  }
}