Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8380969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:35:39+00:00 2026-06-09T16:35:39+00:00

I am building a Google Analytics Dashboard and have it pretty completed, but am

  • 0

I am building a Google Analytics Dashboard and have it pretty completed, but am just totally stumped on this one thing that is really hanging me up.

When I query the GA Core Reporting API for a dataset, I successfully get and am able to display results and everything works fine EXCEPT I am not able to query the JSON object for the “start-index”. That is, the first row that it will display (default = 1, but GA only returns 10k rows at a time, so if you have a data set with >10k rows, this becomes critically important!).

To attempt to get this integer, I use

$start = $results->query.start-index;

and as a check to make sure I am not insane, “max-results” is right next to “start-index” in the JSON object and this works fine:

$max = $results->totalResults;

Here is the GA JSON object (per https://developers.google.com/analytics/devguides/reporting/core/v3/reference#startIndex)

{
"kind": "analytics#gaData",
 "id": string,
"selfLink": string,
"containsSampledData": boolean,
"query": {
  "start-date": string,
  "end-date": string,
  "ids": string,
  "dimensions": [
    string
  ],
  "metrics": [
    string
  ],
  "sort": [
    string
  ],
  "filters": string,
  "segment": string,
  "start-index": integer,
  "max-results": integer
},
"itemsPerPage": integer,
"totalResults": integer,
"previousLink": string,
"nextLink": string,
"profileInfo": {
  "profileId": string,
  "accountId": string,
  "webPropertyId": string,
  "internalWebPropertyId": string,
  "profileName": string,
  "tableId": string
},
"columnHeaders": [
  {
    "name": string,
    "columnType": string,
    "dataType": string
  }
],
"rows": [
  [
    string
  ]
],
"totalsForAllResults": [
  {
    metricName: string,
    ...
  }
]
}

Help! Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T16:35:41+00:00Added an answer on June 9, 2026 at 4:35 pm

    So I am still not entirely sure why this works the way it does, but I’ve successfully pulled the correct start-index number using the following function:

    function getStartIndex(&$results) {
      $query = $results->getQuery();
    
      foreach ($query as $paramName => $value) {
        if($paramName == "start-index")
        $startIndex = $value;
      }
      return $startIndex;
    }
    

    This essentially loops through the entire $query associative array until it finds one where the parameter matches “start-index” and then returns the value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building this Google Chrome extension and I find it a nuisance to have
I'm thinking of building an application for myself that is similar to Google Analytics,
We're building a dashboard similar to what Google Analytics has done and want a
I'm building a dashboard that will pull in data from GA. To do this
I'm currently building a library around the Google Analytics Data Export API. When i'm
I'm building a web app that integrates with Google Drive, and am wondering if
I read the tutorial, https://developers.google.com/apps-script/articles/building-sites-app-part2 that uses spreadsheet service in Google sites. The code
I'm building a sort of analytics platform for fun this weekend and here is
I'm building a Google App Engine web app, with a Java back end, that
This is a followup of this question. Where I was building a google apps

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.