当前位置:网站首页>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】入门第一课:数据库知识科普
- Day111.尚医通:集成NUXT框架、前台页面首页数据、医院详情页
- Zero training platform course-1. SQL injection Foundation
- Shell enterprise interview exercise
- Regular expression foundation sorting
- Lua有状态迭代器
- Solidity智能合约开发 — 3.3-solidity语法控制结构
- 【Day42 文献精读】A Bayesian Model of Perceived Head-Centered Velocity during Smooth Pursuit Eye Movement
- DEMO SUBMIT 某程序并获取该程序ALV数据
- 企业架构驱动的数字化转型!
猜你喜欢
随机推荐
shell awk相关练习
OpenGL shader learning notes: varying variables
Hu related configuration
linux中mysql表名区不区分大小写
RestTemplate 连接池配置
The first open source MySQL native HTAP database in China will be released soon! Look at the three highlights first, limited to the surrounding areas, waiting for you~
shell脚本学习day01
【已解决】单点登录成功SSO转发,转发URL中带参数导致报错There was an unexpected error (type=Internal Server Error, status=500)
C event usage case subscription event+=
如何获取广告服务流量变现数据,助力广告效果分析?
How to get DDL information of an object
C#winform 窗体事件和委托结合用法
Interview reply V
Enhancement: BTE process introduction
Day111.尚医通:集成NUXT框架、前台页面首页数据、医院详情页
Day111. Shangyitong: integrate nuxt framework, front page data, hospital details page
C# 中的转译字符'/b'
glGetUniformLocation,glUniform4f
小程序支付管理-新版支付对接流程
Redisson 3.17.5 发布,官方推荐的 Redis 客户端








