Associate AJAX results with initial data?

Associate AJAX results with initial data?

This is tough to explain which makes it impossible to search on. I'm guessing this is very basic.

I have an array of objects with variables and ids.

  1. [
  2.       {
  3.             id: "totalCountOfPeopleToSite",
  4.             action: "add",
  5.             metric: "ga:visitors"
  6.             ...
  7.       }, {}
  8. ]

I loop through this array and create an AJAX request to Google Analytics who returns the data I requested (or an error).

When the data comes back, I want to re-associate it with the object used to make it (as you can see, there might need to be an action performed on it and it should be stored with its ID so I can use it later).

I feel like I've read about a built-in way to pass along arbitrary information (in this case just getting an AJAX request with my made up "id" would be enough), but I can't find it anywhere, and I'm not explaining myself well enough to the Google to get results back.

Can someone give me a nudge?

Best,
Nate