当前位置:网站首页>How to obtain the cash flow data of advertising services to help analyze the advertising effect?
How to obtain the cash flow data of advertising services to help analyze the advertising effect?
2022-07-27 07:51:00 【nginx】
For this purpose, the advertising service also provides a flow realization service report API(Publisher Service Reporting API), By accessing the API, Developers can obtain the relevant data of in app advertising cashing , Including advertising requests 、 Return quantity 、 Display rate 、 Click through rate, etc , So that developers can analyze the advertising effect based on the data , So as to adjust the delivery strategy in time .

Developers can achieve their own report display effect according to the returned data
So how to get the flow realization data ? The following are the specific integration steps .
One . Get the client ID And the key
Before obtaining the liquidation data , We need to have OAuth 2.0 client ID And the key , Used to generate call reports API When it came in access_token, It should be noted that the client here ID And keys do not mean APPGallery Connect The application of ClientID, But through the Huawei developer alliance -> The client of the server application created in the credentials ID.

- Register as a developer , Complete real name authentication . Log in to Huawei developer Alliance , Click on the top right corner “ Management Center ” Go to the main page .

- Get into “ voucher ” page , Create project , If there are already items, please skip 【 step a】.

b. Select the item you want to create , Click on “ determine ”.

- choice “OAuth 2.0 client ID” Create client ID.

explain :
If the project already exists “OAuth 2.0 client ID” voucher , You need to check whether the product type is a server application , If it is a server application, you can skip 【 step 4】.
Inspection method : Click “ edit ” Button , see “ The product type ”.


If not “ Server applications ” type , Need to recreate “OAuth 2.0 client ID”:

- choice “ Server applications ”, Input “ The product name ”, choice “ The application type ” and “ default language ”, Click on “ establish ”; Tips “ client ID” and “ secret key ”, Click on “ determine ”.

- Get into “ my API” page , Confirm the selected item , Click on “ Apply for a new HMS API service ”.

- Drop down to find “App Services”, Click on “ Flow realization service report API”.

- Click on “ Enable ”, Open the flow realization service report API, Then you can call the flow realization report API 了

stay “ Discontinue use ” after , Again “ Enable ” when , Due to page caching and other reasons , The effective time is non real time , Need to wait about 6~10 minute . If 10 Minutes later, it didn't take effect , Please try again .
Two . Call the flow realization report API
- Call the flow realization report API You need to get access_token Authentication information .
POSThttps://oauth-login.cloud.huawei.com/oauth2/v3/token
Request example :
POST /openapi/monetization/reports/v1/publisher HTTP/1.1
POST /oauth2/v3/token HTTP/1.1Host: oauth-login.cloud.huawei.comContent-Type: application/x-www-form-urlencodedgrant_type=client_credentials&client_id=< client ID >&client_secret=< Client key >```Request sample screenshot :It should be noted that , client ID And the key , It is the client of the server application obtained from the developer alliance interface ID And the key , Not in APPGallery Connect The client of the mobile application created in ID And the key .2. Get access_token After authentication information , Call report API.Call interface :POST https://ads.cloud.huawei.com/openapi/monetization/reports/v1/publisherThe Russian site needs to call the following interfaces :POST https://ads-drru.cloud.huawei.ru/openapi/monetization/reports/v1/publisherRequest example :
Content-Type: application/json
Authorization: Bearer ***
Accept: application/json
Content-Length: 233
{
"start_date": "2022-06-01",
"end_date": "2022-06-28",
"filtering": {
"currency": "CNY"
},
"time_granularity": "STAT_TIME_GRANULARITY_DAILY",
"page": 1,
"page_size": 10
}
Request sample screenshot :You can see from the screenshot , Data returned successfully . Specific request parameters , And response parameters can be referred to [ Document links ](https://developer.huawei.com/consumer/cn/doc/development/HMSCore-References/query-publisher-service-reports-0000001050933546#section20939514163519?ha_source=hms1)call API After obtaining the data of the realization report , Developers can realize the presentation form of data according to their own needs .### 3、 ... and . Common problems when accessing the flow realization report** Call the flow realization service report API When to return to access forbidden?**Cause analysis :1. In the developer alliance interface “API” The flow realization report of the corresponding project is not opened in the column API switch .2. Traffic report API switch “ Enable ” after , Haven't waited for the permission to take effect , Call the report API Interface .3. obtain access_token Authentication information , Incoming clients ID And the key , Not the developer alliance interface “ voucher ” Server application ID And the key .** resolvent :**1. Open the flow report API switch , In the developer alliance interface -> my API-> Select the corresponding project -> Click on “ Apply for a new HMS API service ”, find “ Flow realization service report API” jurisdiction , Click on “ Enable ”.2. Traffic report API switch “ Discontinue use ” after , Again “ Enable ” when , Not effective in real time , Need to wait about 6~10 minute .3. Check to get access_token Authentication information , Incoming clients ID Is it server application . In the developer alliance interface -> voucher -> Find the corresponding project -> Click the Edit button applied under the project , You can see the application type in the line of product type . If it's not a server application , Please replace the client of the server application ID And key and try again .** Learn more >>**visit [ Advertising service official website ](https://developer.huawei.com/consumer/cn/hms/huawei-adskit?ha_source=hms1)visit [ Official website of Huawei developer Alliance ](http://developer.huawei.com/consumer/cn/hms?ha_source=hms1)obtain [ Development guidance document ](http://developer.huawei.com/consumer/cn/doc/development?ha_source=hms1)Huawei mobile service open source warehouse address :[GitHub](http://github.com/HMS-Core)、[Gitee](http://gitee.com/hms-core)** Pay attention to our , The first time to understand HMS Core Latest technical information ~**
边栏推荐
- [stonedb class] introductory lesson 1: popular science of database knowledge
- Am I delayed by the code... Unfortunately, I became a programmer
- Lua有状态迭代器
- 【已解决】单点登录成功SSO转发,转发URL中带参数导致报错There was an unexpected error (type=Internal Server Error, status=500)
- MySQL table name area in Linux is not case sensitive
- Demo submit a program and obtain ALV data of the program
- LeetCode56. 合并区间
- 正则 和 sed 练习
- RPC remote procedure call
- 小程序消息推送配置 Token校验失败,请检查确认
猜你喜欢

Apifox安装及使用

物联网工业级UART串口转WiFi转有线网口转以太网网关WiFi模块选型

大家节日快乐哈
为啥国内大厂都把云计算当成香饽饽,这个万亿市场你真的了解吗

Comprehensive analysis of ADC noise-02-adc noise measurement method and related parameters

Sword finger offer 58 - I. flip word order

Demo:pa30 Bank Country Code default CN enhancement

国内首款开源MySQL原生HTAP数据库即将发布!三大亮点抢先看,限量周边等你来~

What is the real HTAP? (2) Challenge article

什么是真正的HTAP?(一)背景篇
随机推荐
JS存取cookie示例
kalibr标定realsenseD435i --多相机标定
Happy holidays, everyone
C language: random number + Hill sort
帮个忙呗~不关注不登录,不到一分钟的一个问卷
RestTemplate 连接池配置
想让照片中的云飘起来?视频编辑服务一键动效3步就能实现
这次龙蜥展区玩的新花样,看看是谁的 DNA 动了?
单片机多级菜单
Showdoc vulnerability learning - cnvd-2020-26585 (arbitrary file upload)
小程序支付管理-新版支付对接流程
Shell Scripts相关
Lu Xun: I don't remember saying it, or you can check it yourself!
综合案例、
鲁迅:我不记得说没说过,要不你自己查!
将对象转换为键值对
[resolved] SSO forwarding succeeded, and there was an unexpected error (type=internal server error, status=500) caused by parameters in the forwarding URL
JS access cookie example
Enhancement: BTE process introduction
Zero training platform course-1. SQL injection Foundation