-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathrun.py
41 lines (37 loc) · 809 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
from functions import return_ga_data, save_df_to_excel
df = return_ga_data(
start_date='2017-09-13',
end_date='2017-09-21',
view_id='100555616',
metrics=[
{'expression': 'ga:sessions'},
],
dimensions=[
{'name': 'ga:source'},
],
split_dates=True,
group_by=['ga:source'],
dimensionFilterClauses=[
{
'operator': 'OR',
'filters': [
{
'dimensionName': 'ga:userType',
'not': False,
'expressions':[
'new visitor'
],
'caseSensitive': False
}
],
}
],
segments=[]
)
print(df)
# save_df_to_excel(
# df=df,
# path='C:\\Users\\Erik\\Documents\\',
# file_name='test_export',
# sheet_name='data'
# )