How to get server response status for posts in google analytics api or filtering out pages with 404 status?

I have developed an custom google analytic plugin for wordpress for my own use.

I am able to retrieve pagePathLevel1 of posts and views in result table, but it contains a lot of 404.html pages and some other pages having different pagePathLevel1 but will get server response code 404 if visited as those pages are not in my site now( some are already deleted and some links do not belongs to me )

Read More

I want to know page status of all the pages/posts for which I am able to retrieving the views and pagePathLevel1 . is there any way I can achieve this.

 return $analytics->data_ga->get(
          'ga:' . $profileId,
          $start_date,
          $end_date,
          'ga:pageviews,ga:uniquePageviews',

          array('dimensions' => 'ga:pagePathLevel1', 'filters' => $filter ) );


    }

Another Note is ,

I am using it to get analytics report of another of my site, I have
added a select box to select the site and retrieving the data , I want
to achieve this working for both .

Note:-I am not using “gapi” api, It is only google client api PHP, no idea id It has the facility to create a custom dimension and get server response code for all pages.

If It is not possible, Can any one suggest, if I can filter out all pages having server response code 404 and get all pages which are currently on site.

If it needs more details to answer me, please ask questions, I will add the new required details to this question.

Related posts