params = {'ids': 'ga:' + profile_id, 'start_date': start_date, 'end_date':
    end_date, 'metrics': ','.join(metrics), 'dimensions': ','.join(
    dimensions), 'start_index': 1, 'max_results': max_results}
has_more = True
while has_more:
    results = service.data().ga().get(**params).execute()
params['start_index'] = int(params['start_index']) + int(params['max_results'])
has_more = results.get('nextLink')
Using nextLink attribute to get the next result page