I have run the introduction code for Python, and it works. https://developers.google.com/analytics/devguides/reporting/core/v4/quickstart/installed-py
Inside the Analytics Web App I can find a page by Page Title
and there I have metrics like pageView and avg. time on page.
Now, I would like to query the analytics API to get the same metrics for a batch of Page Title
s.
The use is for dataset creation, so I will just run this query a couple of times.
I find the documentation confusing, so any help that would point me in the right direction would help.
Thank you
You can query google analytics using below standard json as input to batchGet
method
{
"reportRequests": [
{
"viewId": "",
"dateRanges": [
{
"startDate": "",
"endDate": ""
}
],
"metrics": [
{
"expression": ""
}
],
"dimensions": [
{
"name": ""
}
],
"dimensionFilterClauses": [
{
"filters": [
{
"expressions": []
}
]
}
]
}
]
}
in expressions
, you can add a list of queries you would like to give.
This is basic query structure which will be using OR
as FilterLogicalOperator
But, In case you want to add more then specify operator
with expressions