GA data is different from GA Dashbaord and GA API

纵饮孤独 提交于 2019-12-12 03:44:30

问题


I am trying to fetch GA data from GA Java APis.When i fetch data for a particular URL its page views data and time spent on page data form API is different for same time range.

For one URL i got this difference.

This is query

{
dateRanges=[{
    endDate=2016-07-28,
    startDate=2016-07-28
}],
dimensionFilterClauses=[{
    filters=[{
        dimensionName=ga: pagePath,
        expressions=[/53433409.cms],
        operator=REGEXP
    }]
}],
dimensions=[{
    name=ga: pagePath
},
{
    name=ga: hostname
}],
metrics=[{
    alias=PageViews,
    expression=ga: pageviews
},
{
    alias=TimeOnPage,
    expression=ga: timeOnPage
}],
samplingLevel=LARGE,
viewId=123
}  

Response

{
"reports": [{
    "columnHeader": {
        "dimensions": ["ga:pagePath",
        "ga:hostname"],
        "metricHeader": {
            "metricHeaderEntries": [{
                "name": "PageViews",
                "type": "INTEGER"
            },
            {
                "name": "Time On Page",
                "type": "TIME"
            }]
        }
    },
    "data": {
        "isDataGolden": true,
        "maximums": [{
            "values": ["16996",
            "1360186.0"]
        }],
        "minimums": [{
            "values": ["76",
            "391.0"]
        }],
        "rowCount": 5,
        "rows": [{
            "dimensions": [" x.x.com/articleshow_comments/53433409.cms",
            " x.x.com"],
            "metrics": [{
                "values": ["76",
                "391.0"]
            }]
        },
        {
            "dimensions": [" x.x.com/life-style/home-garden/abc/amp_articleshow/53433409.cms",
            " x.x.com"],
            "metrics": [{
                "values": ["681",
                "14714.0"]
            }]
        },
        {
            "dimensions": [" x.x.com/life-style/home-garden/abc/articleshow/53433409.cms",
            " x.x.com"],
            "metrics": [{
                "values": ["88",
                "3228.0"]
            }]
        },
        {
            "dimensions": [" x.x.com/life-style/home-garden/abc/articleshow/53433409.cms",
            " x.x.com"],
            "metrics": [{
                "values": ["14361",
                "1272052.0"]
            }]
        },
        {
            "dimensions": ["m.x.x.com/life-style/home-garden/abc/articleshow/53433409.cms",
            "m.x.x.com"],
            "metrics": [{
                "values": ["16996",
                "1360186.0"]
            }]
        }],
        "samplesReadCounts": ["999997"],
        "samplingSpaceSizes": ["12608639"],
        "totals": [{
            "values": ["32202",
            "2650571.0"]
        }]
    }
}]

}

Java API :
PV : 32000
Time Spent total : 2642623

From dashboard
PV : 31000
Time Spent total : 5397828

Time range given from 28 mid night to 29 mid night as GA takes absolute date always.

dateRanges=[{endDate=2016-07-28, startDate=2016-07-28}

Has anyone seen this kind of issue. I have included sampling level large but still it is not including all samples.
We have premium account.

Thanks Virendra Agarwal

来源:https://stackoverflow.com/questions/38653527/ga-data-is-different-from-ga-dashbaord-and-ga-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!