Json format issue when comes from Google Analytics

One Star

Json format issue when comes from Google Analytics

I try to add a JSON file in the repository. This Json file comes from Google Analytics API.
This file is well formed but I can declare it in the directory due to the error ""{0}" is not found or the json format is incorrect."
Please find below the content of my Json file.
{
"kind": "analytics#gaData",
"id": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:xxxx&dimensions=ga:medium,ga:source&metrics=g...Smiley Tongue",
"query": {
"start-date": "2013-03-01",
"end-date": "2013-03-31",
"ids": "ga:xxxx",
"dimensions": "ga:medium,ga:source",
"metrics": ,
"sort": ,
"start-index": 1,
"max-results": 999
},
"itemsPerPage": 999,
"totalResults": 139,
"selfLink": "https://www.googleapis.com/analytics/v3/data/ga?ids=ga:xxxx&dimensions=ga:medium,ga:source&metrics=g...Smiley Tongue",
"profileInfo": {
"profileId": "xxxx",
"accountId": "yyyy",
"webPropertyId": "UA-aaaa",
"internalWebPropertyId": "zzzz",
"profileName": "Production",
"tableId": "ga:xxxx"
},
"containsSampledData": false,
"columnHeaders": ,
"totalsForAllResults": {
"gaSmiley Tongueageviews": "1234",
"ga:visits": "123",
"ga:visitors": "12"
},
"rows": ,
,
,

]
}
Seventeen Stars

Re: Json format issue when comes from Google Analytics

Probably you can avoid parsing it by using the tGoogleAnalyticsInput component from talend exchange:
http://www.talendforge.org/exchange/index.php?eid=537&product=tos&action=view&nav=0,1,1
This component use the Java API to Google Analytics and parse everything for you.
The next advantage is, you don't have to define for every query a new json metadata schema.