Learn business growth with Google Analytics 4 › Forums › Google Analytics 4 › How can I retrieve adCost and adClicks information for a property using the GA4 Data API? › Reply To: How can I retrieve adCost and adClicks information for a property using the GA4 Data API?
-
The error might be because you’re not adding a dimension to your request. For the new GA4 data API, certain metrics require a corresponding dimension to provide context for your data. In your case, you might need to include ‘sessionCampaignName’ as a dimension. You can test your request using Google’s GA4 Data API’s query explorer, and if the dimension is missing, it will recommend adding it. Including the mentioned dimension should return the result you’re looking for, given that there’s available data related to your metrics.