I'm trying to receive data from google analytics to make specific report. This report does not include any metric but only dimensions. The problem is that batchGet requests a metric in order to send a request properly. This is the how the data is requested via Data Studio

As you can see the metric section is empty.
And this is how I run the batchGet request (using python)
analytics.reports().batchGet(
body={
'reportRequests': [
{
'viewId': VIEW_ID,
'dateRanges': [{'startDate': '2022-01-01', 'endDate': '2022-01-01'}],
'metrics': [],
'dimensions': [{'name': 'ga:date'},
{'name': 'ga:transactionId'},
{'name': 'ga:adContent'},
{'name': 'ga:source'},
{'name': 'ga:medium'},
{'name': 'ga:campaign'},
{'name': 'ga:keyword'}]
}]
}).execute()
When I run this code I get an error:
"Selected dimensions and metrics cannot be queried together."
And that's because I ask both dimensions {'name': 'ga:transactionId'},{'name': 'ga:adContent'} in the same request.
How can I request this data and receiving this without any errors, because I know I can see it in Data Studio but I cannot request it via Google Analytics Core Reporting API.
Thanks in advance,
Tom
Not all dimensions and metrics can be queried together.
Google Analytics has different scopes for dimensions and metrics:
Hits and Sessions.So when you build you report and you are calling hits (or 'hit-level metrics'), you must call dimensions only within that scope.There is no work around for this error other than removing one of the offending items. you can use the Dimension and metric refrence to see which one match.