Search code examples
apigoogle-apiadmobgoogle-apis-exploreradsense-api

Accessing Campaigns report in AdMob using Adsense API


I use Adsense API to access my AdMob account and generate reports. This is the main API request that I use:

https://www.googleapis.com/adsense/v1.4/accounts/accountId/reports

Documentation

The API offer many options for reporting, but what I need the most is the campaigns report, mainly to know the impressions and clicks of each campaign that I have in AdMob. This can be accessed from here:

enter image description here

The report of the campaigns can be accessed also inside Mediation report as they are categorized as "Ad source":

enter image description here

I have tried all the Metrics and Dimensions in this page to access the campaigns report, but it didn't work. The API doesn't seem to return any data that is related to the campaigns or mediation report.

I also looked for the data of AdMob campaigns by using Adwords API. After creating these campaigns in AdMob, they automatically appear in my Google Ads (AdWord) account. Here is a screenshot of my Google Ads account:

enter image description here

The campaigns in the screenshot above that were named AdMob Campaign were created inside AdMob, and the campaign that was named Google Ads Campaign were created inside Google Ads. However, when I request the campaign data using AdWord API, it returns only the campaigns that were created inside Google Ads (AdWord) account. So, even though the account shows them, the AdWord API doesn't return their data.

It is interesting that these campaigns appear in both AdMob and Google Ads accounts, but both APIs of these services are not returning their data. It seems that there is something missing somewhere.

Does anyone know how I can get the data of the Campaigns that were created inside AdMob? I appreciate any help.


Solution

  • Google finally introduced a new API for AdMob: https://developers.google.com/admob/api

    The new API can access campaign data using mediationReport.generate. Just make sure your dimensions include AD_SOURCE_INSTANCE to be able to access them.

    Here are more data about the new API: https://developers.google.com/admob/api/v1/reference/rest/v1/accounts.mediationReport/generate

    I tested it today, and it is working well!