Where Google Analytics times out and returns an error, the result counter is reset to 0, and starts retrieving paths from GA at 1. On a site with several hundred thousand paths, we are seeing enough timeouts that GA is never queried the paths with higher numbers, becuase the process keeps starting over.
The problem seems to be in google_analytics_counter_data.inc:
// The total number of records for this profile.
$resultcount = @$new_data->results->totalResults;
// Store it in a variable.
variable_set('google_analytics_counter_totalpaths', $resultcount);
If there is a timeout, $new_data->results->totalResults is 0, and $resultcount is reset. We probably need a condition:
if (empty($new_data->error)) {
// The total number of records for this profile.
$resultcount = @$new_data->results->totalResults;
// Store it in a variable.
variable_set('google_analytics_counter_totalpaths', $resultcount);
... // down to the end of the function
}
or some more elegant fix.