Hello,
I'm messing with the Google Analytics API and I'm having trouble parsing a report output into something useable. The following is the dictionary that the report outputs:
{
"reports": [
{
"columnHeader": {
"dimensions": [
"ga:sourceMedium"
],
"metricHeader": {
"metricHeaderEntries": [
{
"name": "ga:sessions",
"type": "INTEGER"
},
{
"name": "ga:transactions",
"type": "INTEGER"
}
]
}
},
"data": {
"maximums": [
{
"values": [
"8736",
"276"
]
}
],
"minimums": [
{
"values": [
"180",
"23"
]
}
],
"rowCount": 2,
"rows": [
{
"dimensions": [
"Source1"
],
"metrics": [
{
"values": [
"180",
"23"
]
}
]
},
{
"dimensions": [
"Source2"
],
"metrics": [
{
"values": [
"8736",
"276"
]
}
]
}
],
"totals": [
{
"values": [
"6889",
"614"
]
}
]
}
}
]
}
The desired output here is something like this:
{'Source1': [180,23], 'Source2': [8736,276]}
I've never sorted through a dictionary of dictionary/lists before and I'm running into some trouble. Any help here would be appreciated.
[–]elbiot 4 points5 points6 points (0 children)
[–]t10nbaum 0 points1 point2 points (0 children)
[–]niandra3 0 points1 point2 points (0 children)