Skip to content

Commit

Permalink
add more global reports
Browse files Browse the repository at this point in the history
  • Loading branch information
FuhuXia committed Dec 3, 2024
1 parent 6463553 commit 42fc207
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions metrics/datagov_metrics/ga.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,57 @@ def setup_global_reports():
"orderBys": [{"metric": {"metricName": "activeUsers"}, "desc": True}],
}

global_reports["global__download_requests__last30"] = {
"dateRanges": date_range_last_month(),
"dimensions": [
{"name": "linkUrl"},
{"name": "fileExtension"},
{"name": "fileName"},
],
"dimensionFilter": {
"andGroup": {
"expressions": [
{
"filter": {
"fieldName": "eventName",
"stringFilter": {
"matchType": "EXACT",
"value": "file_download",
},
}
},
],
},
},
"metrics": [{"name": "eventCount"}],
"orderBys": [{"metric": {"metricName": "eventCount"}, "desc": True}],
}

global_reports["global__link_requests__last30"] = {
"dateRanges": date_range_last_month(),
"dimensions": [
{"name": "linkUrl"},
{"name": "customEvent:DATAGOV_dataset_organization"},
{"name": "customEvent:DATAGOV_dataset_publisher"},
{"name": "outbound"},
],
"dimensionFilter": {
"andGroup": {
"expressions": [
{
"filter": {
"fieldName": "outbound",
"stringFilter": {"matchType": "EXACT", "value": "true"},
}
},
],
},
},
"metrics": [{"name": "eventCount"}],
"orderBys": [{"metric": {"metricName": "eventCount"}, "desc": True}],
}


return global_reports


Expand Down

0 comments on commit 42fc207

Please sign in to comment.