I'm trying to solve this issue for the last 2 days.
When I'm using Google Analytics API V4 I get fewer results than I'm using the API V3.
I'm using the exact same parameters in both versions.
API v4 implementation
Uri: https://analyticsreporting.googleapis.com/v4/reports:batchGet?access_token=_ACCESS_TOKEN_
Method: POST
Body:
{
reportRequests: {
viewId: "3829366",
dateRanges: {
startDate: "2017-05-19",
endDate: "2017-05-19"
},
dimensions: [
{
name: "ga:dimension1"
},
{
name: "ga:source"
},
{
name: "ga:medium"
},
{
name: "ga:campaign"
},
{
name: "ga:channelGrouping"
},
{
name: "ga:fullReferrer"
},
{
name: "ga:adMatchedQuery"
},
{
name: "ga:country"
},
{
name: "ga:city"
}
],
metrics: [
{
expression: "ga:sessions"
}
],
filtersExpression: "ga:dimension1=~(598a56704f19aa39c5)|(674456acd5f2a5f1c2)|(9545632042f1223ced)|(24a1e3c96ba81890dc)|(7dd83f2d0321aae0d6)|(a68f93efad7d7574c8)",
samplingLevel: "LARGE"
}
}
From this call I get only 1 result.
API v3 implementation
Uri: https://www.googleapis.com/analytics/v3/data/ga
Method: GET
Query Parameters:
?ids=ga:3829366
&start-date=2017-05-19
&end-date=2017-05-19
&metrics=ga:sessions
&dimensions=ga:dimension1,ga:source,ga:medium,ga:campaign,ga:channelGrouping,ga:fullReferrer,ga:adMatchedQuery
&filters=ga:dimension1=~(598a56704f19aa39c5)|(674456acd5f2a5f1c2)|(9545632042f1223ced)|(24a1e3c96ba81890dc)|(7dd83f2d0321aae0d6)|(a68f93efad7d7574c8)
&samplingLevel=higher_precision
&access_token=_ACCESS_TOKEN_
From this call I get 6 results, the right results.
I would be very grateful for any help!
Thanks!