Hi I'm trying to do some charting with Google Analytics and I can get the data into JSON but I get stuck from there, this is the json as seen in firebug.
{"total_results":1,"rows":[[7861]],"column_headers":[{"dataType":"INTEGER","columnType":"METRIC","name":"ga:visits"}]}
So I'm trying to extract the fact that gavisits has 7842 results for the last 30 days, this is my code
$.getJSON(
"https://api.oocharts.com/v1/query.jsonp?" //note the 'jsonp' return type
+ "query=" + "visits-by-date-cg"
+ "&key=" + "myapikey here"
+ "&start=" + "30d" //30 days from current date
+ "&callback=?"
, null, function(data) {
console.log(JSON.stringify(data));
});
How do I loop through the 'data' to get 7842 so that I can store this as a variable?
Thank you