Analytics
2K members online now
2K members online now
Ask questions about filter set-up and issues with using filters in Google Analytics reports
 
Guide Me
star_border
Reply

"Exclude Sessions" in API V4 request is impossible?

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi all,

I can't figure out  how to set "Exclude" segment condition for the Core Reporting API V4. Seems it  doesn't allowed directly  as  in  user interface.  

Suppose I'd like to segment sessions containing none of pages: P1,P2,..Pn. In GA user interface I can do it easly:

Sessions-Exclude-Page-match regex- P1|P2|..|Pn

 

How to configure the same segment but in terms of  API V4?

Thanks!

 

1 Expert replyverified_user

"Exclude Sessions" in API V4 request is impossible?

Rising Star
# 2
Rising Star

Hi Dmitry,

 

If this a static request you can simply create the segment in GA and then call the segment id. If you need to use dynamic segments you match the filter but use the "not" operator.

 

 

https://developers.google.com/analytics/devguides/reporting/core/v4/rest/v4/reports/batchGet#Dimensi...

 

Best,

 

Theo Bennett

Analytics Evangelist at MoreVisibility | Contact Me
Connect on LinkedIn

"Exclude Sessions" in API V4 request is impossible?

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Theo,

 

Thanks for the comment. Currently I see no choise but using of static segment. If I use "not" operator the result will be the same as the following user interface segment analog:

Sessions-Include-Page-not match regex- P1|P2|..|Pn  

 

I.e. sessions containing at least one page deffered from p1..pn. It is not what I need

 

Best,

Dmitry