Google AnalyticsAPI--各种产品的API和信息中心之间的数据差异

时间:2017-03-16 08:04:58

标签: google-analytics-api

我们面临着各种产品的API响应和Google Analytics信息中心网页浏览量数据差异的严重问题,有趣的是图表相同,我们使用下面提到的API端点来获取网页浏览量:

API终点:

  

https://content.googleapis.com/analytics/v3/data/ga

请求:

{
    start-date:2017-02-01
    end-date:2017-02-28
    ids:ga:108134524
    metrics:ga:pageviews
    dimensions:ga:hostname
    sort:-ga:pageviews
    filters:ga:hostname!=/;ga:dimension10==56b261282cbcbe7073adb603
    output:dataTable
    _src:embed-api:v1
}

响应

enter code here

{     
     "kind":"analytics#gaData",
     "id":"https://www.googleapis.com/analytics/v3/data/ga?    ids=ga:108134524&dimensions=ga:hostname&metrics=ga:pageviews&sort=-ga:pageviews&filters=ga:hostname!%3D/;ga:dimension10%3D%3D56b261282cbcbe7073adb603&start-date=2017-02-01&end-date=2017-02-28",
     "query":{
        "start-date":"2017-02-01","end-date":"2017-02-28",
        "ids":"ga:108134524",
        "dimensions":"ga:hostname",
        "metrics":["ga:pageviews"],
        "sort":["-ga:pageviews"],
        "filters":"ga:hostname!=/;ga:dimension10==56b261282cbcbe7073adb603",
        "start-index":1,"max-results":1000},
        "itemsPerPage":1000,
        "totalResults":1,
        "selfLink":"https://www.googleapis.com/analytics/v3/data/ga?ids=ga:108134524&dimensions=ga:hostname&metrics=ga:pageviews&sort=-ga:pageviews&filters=ga:hostname!%3D/;ga:dimension10%3D%3D56b261282cbcbe7073adb603&start-date=2017-02-01&end-date=2017-02-28",
        "profileInfo":{
            "profileId":"108134524",
            "accountId":"67358318",
            "webPropertyId":"UA-67358318-1",
            "internalWebPropertyId":"103966122",
            "profileName":"All Web Site Data",
            "tableId":"ga:108134524"
        },
        "containsSampledData":true,
        "sampleSize":"250252",
        "sampleSpace":"2964571",
        "columnHeaders":[{
            "name":"ga:hostname",
            "columnType":"DIMENSION",
            "dataType":"STRING"
         },{
            "name":"ga:pageviews",
            "columnType":"METRIC",
            "dataType":"INTEGER"
         }],
         "totalsForAllResults":{"ga:pageviews":"12"},
         "dataTable":{
             "cols":[{
                 "id":"ga:hostname",
                 "label":"ga:hostname",
                 "type":"string"
             },
             {
                 "id":"ga:pageviews",
                 "label":"ga:pageviews",
                 "type":"number"
             }],
             "rows":[{
                 "c":[{"v":"www.australiatourism.travel"},
                 {"v":"12"}]}
             ]}
     }

Google API的响应

Response we are getting on our page using API's

GA上的响应

Response on GA Analytics Page using same parameters

有趣的是,我们正在获得相同的图表,但我们不知道为什么我们会在API端点和Google Analytics信息中心获取不同的页面浏览量以获得相似的日期,请帮我们解决相同的问题?

此致 纳库尔

0 个答案:

没有答案