我创建了以下查询来从 GA 获取事件数据:
request_body = {
'reportRequests': [
{
'viewId': 'xxxxx',
'dateRanges': [{'startDate': '2020-01-01', 'endDate': '2020-03-31'}],
'metrics': [
{'expression': 'ga:itemRevenue'},
{'expression': 'ga:sessionDuration'},
],
# Get Pages
'dimensions': [
{"name": "ga:clientId"},
{"name": "ga:pagePath"},
{"name": "ga:dateHourMinute"},
{"name": "ga:shoppingStage"},
{"name": "ga:eventAction"},
{"name": "ga:source"},
],
# Filter by condition "containing products"
'orderBys': [{"fieldName": "ga:dateHourMinute", "sortOrder": "ASCENDING"}],
'pageSize': 1000,
}]
}
我总共收集了 13.683 行:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 13683 entries, 0 to 13682
Data columns (total 8 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 clientId 13683 non-null object
1 pagePath 13683 non-null object
2 dateHourMinute 13683 non-null object
3 shoppingStage 13683 non-null object
4 eventAction 13683 non-null object
5 source 13683 non-null object
6 itemRevenue 13683 non-null object
7 sessionDuration 13683 non-null object
dtypes: object(8)
memory usage: 855.3+ KB
我在 GA Web 界面中ga:shoppingStage
查看了同一时间段(Q1/CY2020)的购物行为分析(因为我查询过)
我希望在事件中看到类似的数字,但看不到任何匹配项。我究竟做错了什么?