Recently, Small programs wanted to place ads, hoping to analyze user data and make operational decisions. After the first contact from Tencent, the customer sent a development document to our delivery team. We need to quickly spike out whether it can be done and how much effort is needed. After reading for half an hour, I quickly gave the result. There are several points we need to do:

Quick Spike

  • OAuth authentication
  • Refresh access_token periodically
  • The click_id is taken from the URL parameter
  • Landing page to see if you want it done
  • To retrieve user data, call the Marketing API

The above is the result of rapid spike, because at that time we didn’t have a test account, and we couldn’t verify whether these steps were feasible or not, and we didn’t know whether additional operations were needed. But when we actually did it, it wasn’t that much trouble.

truly

  1. Generate test accounts, the bank account contains developer testing, but also contains the advertiser account (from DMP platform can view access data), but this place need to fill in the relevant information of the enterprise, so in when they have to fill in the information such as qq in public qq account, to prevent subsequent staff to mobilize the impact of; In addition, on the DMP platform, we have to ask the company to upload the information related to the enterprise legal person, and we let the customers upload it by themselves.

  1. Create an application (private or third-generation) to get through API calls in production. We are only talking about third-party applications here. It can be seen that a callback address needs to be filled in. This address is used for the page to be redirected after the subsequent advertiser authorization.

  1. Open the provided link to obtain authorization_code from the information about the application. The link is similar to: developers.e.qq.com/oauth/autho…

The developer needs to change the parameters accordingly.

  1. Access_token is generated from authorization_code because access_token is included in the general parameters of the interface, and the need for timed refreshes is eliminated in order to quickly launch this feature. API for generating access_token:

API: api.e.qq.com/oauth/token Method: Get Query params:

  1. Generate user data source:

API: api.e.qq.com/v1.1 Method: Get Query params:

  1. Call Marketing API to report user behavior data according to the above parameters plus some other parameters, and check the accessed data on DMP platform.

API: Api.e.qq.com/v1.3/user_a… Method: POST Query params:

Request body: { “actions”:[ { “action_time”:1605668193, “action_type”:”VIEW_CONTENT”, “user_id”:{ “wechat_openid”: useropenid,”wechatunionid”:null,”wechatappid”:{user_open_id}, “wechat_unionid”:null, “wechat_app_id”: useropenid,”wechatunionid”:null,”wechatappid”:{app_id} }, “trace”: {“click_id”:{click_id} //wx0fzoqjbewm****} “Account_id “:{account_id}, “user_action_set_id”:${user_action_set_id}}

  1. DMP data access example:

Note: Instructions on clickID and how to obtain it and other parameters such as the AD ID are also available:

References:

  1. Tencent advertising development documents
  2. DMP data management platform
  3. AD conversion tracking