title: Exception: Quota Error: User Rate Limit Exceeded
body: <p>I have a Apps Script where I Loop trough my Google Analytics Account till I get to 
  a certain Profile. <br>
  <code>if (profileItems[i].getName() == "Dev Test" )</code>
  <br>
  Than in another function (see bellow) I make the call to the Google Analytics API and always get the Exception thrown: Exception: <em>Quota Error: User Rate Limit Exceeded</em> <br>
  <br></p>
  
  <pre><code>function getReportDataForProfile(profileId) {
  var tableId = 'ga:' + profileId;
  var startDate = getLastNdays(14);   // 2 weeks (a fortnight) ago.
  var endDate = getLastNdays(0);      // Today.
  
  var optArgs = {
    'dimensions': 'ga:keyword',              // Comma separated list of dimensions.
    'sort': '-ga:visits,ga:keyword',         // Sort by visits descending, then keyword.
    'segment': 'dynamic::ga:isMobile==Yes',  // Process only mobile traffic.
    'filters': 'ga:source==google',          // Display only google traffic.
    'start-index': '1',
    'max-results': '250'                     // Display the first 250 results.
  };
  
  //
  //Exponential Backoff
  //
  for (var n=0; n&lt;6; n++) {
  try {
       var results = Analytics.Data.Ga.get(
       tableId,                  // Table id (format ga:xxxxxx).
       startDate,                // Start-date (format yyyy-MM-dd).
       endDate,                  // End-date (format yyyy-MM-dd).
       'ga:visits,ga:pageviews', // Comma seperated list of metrics.
       optArgs);
   } catch(e) {
     if (n == 5) {
       //var results = e;
       //throw new Error('Quota ERROR');
       throw (e) 
     } 
     Utilities.sleep((Math.pow(2,n)*1000) + (Math.round(Math.random() * 1000)));
    }    
  }   
   return results;
  }   
  </code></pre>
  
  <ul>
  <li>I increased the number of the Per user Limit in the API Console to 10.0<br></li>
  <li>The used Porcentage is 6% <br></li>
  <li>And I applied the Exponential Backoff<br></li>
  <li>I also believe that by just asking for the Visits and PageViews I am not 
  exagerating my number of calls. </li>
  </ul>
  
  <p><a href="https://sites.google.com/a/lagaroo.com.br/dev-test/about/stats">The full code</a></p>
  
  <p>Any ideias what is going on?</p>