I can't use URL_CHANNEL_NAME dimension, leads to HTTP 400

Skip to first unread message

Stefan Djurovic

Oct 10, 2022, 9:14:31 AM10/10/22
to AdSense API Forum
I'm looking into extracting earnings per specific URL but just can't pull it off.

In simple terms want to use these URL_CHANNEL_NAME as dimensions, and ESTIMATED_EARNINGS as a metric.

I'm using Python and followed this sample as a reference: https://github.com/googleads/googleads-adsense-examples/blob/main/v2/python/generate_report.py

Tried to create a saved report with URLs, then pull it via the API but still end up with the same error message.

Did someone encounter these issues as well?

Ad Sense API

Oct 12, 2022, 7:57:07 AM10/12/22
to stefandju...@gmail.com, adsen...@googlegroups.com
Hi Stefan, I apologize for the delayed response.

Are you able to use the API tester on the developer site to experiment with the API calls first? And if so, does that result in a successful response?

Try this URL, first change the account field to what the account you'd like to query, then hit "Execute" at the bottom of the right hand side panel (the "Try this method" panel):

If that's showing you the results you expect, then I'll need to see the request URLs you're sending in order to be able to help further. You can run the python script and copy the URLs from the terminal.

As a side-note, URL channels only work when pre-defined for specific URLs inside the AdSense account. And you can only create a limited number of them. AdSense recently launched a new feature inside reporting which shows you the URL-level breakdown of reports. Go to the reports page in AdSense, and choose the "Page URL" dimension. Note that this dimension only shows URLs that have sufficient traffic, and data is only stored for the past 30 days. You can learn more about this dimension here:

All the best!

Reply all
Reply to author
0 new messages