Parsing webserver JSON Values to data property

0👍

JSON.parse expects a json string, not an URL you need to load the data yourself i.e. using XMLHTTPRequest. Despite the fact that gaValues is undefined, you also need to access object keys containing special characters using the following notation:

gaValues["ga:sessions"]

👍:0

You are trying to parse URL in your code at line var gaValues = JSON.parse(url);
The JSON.parse() method parses a string as JSON. You need to pass your response as parameter not URL.

Leave a comment