Reputation: 1684
I created following query to fetch event data from 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,
}]
}
I collected 13.683 rows in total:
<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
I looked in the GA web interface into the Shopping Behavior Analysis (because I queried ga:shoppingStage
) for the same time period (Q1/CY2020)
as well as the events overview (because I queried ga:eventAction
)
I expected to see similar numbers in the events but can't see any match. What am I doing wrong?
Upvotes: 0
Views: 497
Reputation: 14179
Shopping Behavior Analysis show sessions while events are single interactions. In a single session a user can have multiple interactions (multiple events).
In any case, you are comparing non-comparable reports with mixed scope (user, session, hit).
Upvotes: 1