title: How to get unique users from Google Analytics for all pages in 1 request
body: <p>Is there any way to get unique users for all my pages in 1 GA request?
  I have cca 7.000 pages on my portal and I try to get unique visits of last week, last fortnights, month and quarter year. But google interrupts my script if there is many requests, so i delay every request by 1,5 seconds...
  This is problem because it is interrupted anyway but bigger problem is the time getting the data.
  It is 7000 * 4(periods) * 1,5s + some time to process the data - it's over 10 hours, maybe longer (it runs from yesterday evening and still running).
  Is there some request to get all the pages in 1 request?
  Now i've got somethin like:</p>
  
  <pre><code>$optParams = array(
      'filters' =&gt; $filter, // ga:hostname==' . $detailUrl (from other script)
      'max-results' =&gt; '25');
  
  if('' != $segment) {
      $optParams['segment'] = $segment;
  }
  
  $data = $this-&gt;_analytics-&gt;data_ga-&gt;get(
      'ga:' . $this-&gt;_profileId,
      $from,
      $to,
      'ga:users', // users = unique visitors, sessions = visits
      $optParams);
  
  $uniqueVisitors = $data-&gt;totalsForAllResults['ga:users'];
  
  // Don't want to reach API request limit. Waiting for 1.5s
  usleep(1500000); // 1500000
  
  return $uniqueVisitors;
  </code></pre>
  
  <p>This function returns unique visitor (I hope so) for current page for 1 period...</p>