我需要在Android应用内跟踪来自AdMob的报告。我需要的信息包括展示次数,点击次数,ctr,ecpm和估算收入。是否有某种支持这种情况的api?
答案 0 :(得分:0)
答案 1 :(得分:0)
我不确定我是否正确理解“在应用内部跟踪报道”中的含义,但您猜测可以使用AdSense API进行操作。
简单来说,每个应用都与adunit ID相关联,因此如果您想检查确定应用的统计信息,请检查: https://developers.google.com/adsense/management/v1.3/reference/accounts/reports/generate
accountId = your Publisher ID (pub-XXXXXXX)
startDate and endDate = The interval of dates you want to check
dimension = AD_UNIT_ID
metric = EARNINGS
With this query you'll have the required info, separated by App.
答案 2 :(得分:0)
AdMob API:https://developers.google.com/admob/api
curl -X POST https://admob.googleapis.com/v1/accounts/<your_publisher_id>/networkReport:generate \
-H "'Authorization: Bearer <oauth2_access_token>" \
-H "Content-Type: application/json" \
--data @- << EOF
{
"report_spec": {
"date_range": {
"start_date": {"year": 2020, "month": 4, "day": 2},
"end_date": {"year": 2020, "month": 4, "day": 2}
},
"dimensions": ["APP", "AD_UNIT"],
"metrics": ["AD_REQUESTS", "IMPRESSIONS", "ESTIMATED_EARNINGS"]
}
}
EOF
安装:https://github.com/google/oauth2l
oauth2l header --json <path_to_secret_json> https://www.googleapis.com/auth/admob.report
path_to_secret_json -是来自Google云控制台的凭据页面中的一个。
将 oauth2_client_id 替换为“云项目凭据-OAuth 2.0客户端ID”页面中的一个。 (https://console.developers.google.com/apis/credentials?project=)
https://accounts.google.com/o/oauth2/auth?access_type=offline&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadmob.report&response_type=code&client_id=&redirect_uri = urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob
curl -L \
-d "client_id=<oauth2_client_id>" \
-d "client_secret=<oauth2_secret>" \
-d "grant_type=authorization_code" \
-d "code=<sign_in_code_from_the_previous_step>" \
-d "redirect_uri=urn:ietf:wg:oauth:2.0:oob" \
https://accounts.google.com/o/oauth2/token
可以在OAuth 2.0客户端ID页面上找到oaut2_client_id 和 oauth2_secret 。
响应:
{
"access_token": "<access_token>",
"expires_in": 3600,
"refresh_token": "<refresh_token>",
"scope": "https://www.googleapis.com/auth/admob.report",
"token_type": "Bearer"
}
有关开发者文档的更多详细信息:https://developers.google.com/admob/api/v1/getting-started