use python to detect customer behavior on website and google analytics

Solutions on MaxInterview for use python to detect customer behavior on website and google analytics by the best coders in the world

showing results for - "use python to detect customer behavior on website and google analytics"
Maria
08 Jul 2016
1{'reports': [{'columnHeader': {'dimensions': ['ga:deviceCategory',
2     'ga:pagePath'],
3    'metricHeader': {'metricHeaderEntries': [{'name': 'ga:entrances',
4       'type': 'INTEGER'}]}},
5   'data': {'maximums': [{'values': ['3707']}],
6    'minimums': [{'values': ['0']}],
7    'rowCount': 820,
8    'rows': [{'dimensions': ['desktop', '/'],
9      'metrics': [{'values': ['3707']}]},
10     {'dimensions': ['desktop', '/?knews=confirmUser&k=1bd61f63&e=1352'],
11      'metrics': [{'values': ['1']}]},
12....
13devicecat = []
14url=[]
15entrances=[]
16for i in report['reports'][0]['data']['rows']:
17devicecat.append(i['dimensions'][0])
18url.append(i['dimensions'][1])
19entrances.append(int(i['metrics'][0]['values'][0]))
20