Google Analytics Grouped Filters

I’m currently using node library for google apis to pull data from google analytics reports, we are using v3 implementation and it’s working good so far, however there’s something I wondering how to implement, when adding a filter I understand I can add AND and OR to my filters via either ; or ,. How do you do when you have different grouped filters like in the picture below?

enter image description here

I’m thinking this is not supported on v3 and I might need to start using v4 instead however I might be wrong. This is what I’m trying for the filter:

const { google } = require('googleapis'); const OAuth2Client = google.auth.OAuth2; const analytics ='v3');  const auth = new OAuth2Client(   clientId,   clientSecret,   tokenUri );  auth.setCredentials({   access_token,   refresh_token });  async function loader() {   const res = await     {       ids: '',       maxResults: 10000,       metrics: '',       dimensions: '',       filters: 'ga:landingPagePath!=/weeklyad/?headerless=true;ga:channelGrouping!=Direct;ga:landingPagePath!=/;ga:browser!=Chrome;ga:deviceCategory!=desktop;ga:operatingSystem!=Linux',       'start-date': '2017-12-31',       'end-date': '2020-08-26',       auth     }   );     console.log(res); }  loader().then(() => console.log('done')); 
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.