organicGoogleSearch[....] metrics required dimension
Hello, I'm currently testing the BestaAnalyticsDataClient and had a question about the origanicGoogleSearch... (organicGoogleSearchAveragePosition, organicGoogleSearchClickThroughRate, organicGoogleSearchClicks, organicGoogleSearchImpressions) metrics.
Here's the code :
const [response] = await analyticsDataClient.runReport({
property: `properties/${propertyId}`,
dateRanges: [
{
startDate: '2020-10-11',
endDate: 'today',
},
],
dimensions: [
{
name: '????',
},
],
metrics: [
// {
// name: 'activeUsers',
// },
{
name: 'organicGoogleSearchAveragePosition',
}
],
});
Here's the error code : Error: 3 INVALID_ARGUMENT: The dimensions and metrics are incompatible
I can't seem to find the required dimension to get the data (I'd like to see the data we get from the analytics google search section's default dashboard : the request search terms and its datas).
Have a good day !
Benjamin,
Depending on what you are trying to do, googleAdsQuery, sessionGoogleAdsQuery, firstUserGoogleAdsQuery seem like a good match. Please see the Data API schema for the complete list of supported fields and dimensions. Also, it might be convenient to create a custom report using the Google Analytics UI first, validate your results and then translate the query into a Data API call.