找回密码
 立即注册
首页 业界区 安全 通过实时竞价能力,重塑广告收益曲线

通过实时竞价能力,重塑广告收益曲线

焦听云 6 小时前
19世纪末至20世纪初,传统广告营销模式盛行,通过"包时段、包位置"的采买合约模式,广告主提前数周锁定资源,平台按刊例价结算。然而这种模式存在资源配置不合理、广告主决策滞后和广告投放信息不透明等痛点,为了让平台资源零浪费,广告主出价零盲目,且用户体验零干扰,HarmonyOS SDK广告服务(Ads Kit)提供了实时竞价的能力,帮助广告主在应用平台上实现广告投放利益最大化。
什么是实时竞价

实时竞价是指用户在访问媒体产生曝光机会时,众多家DSP(Demand Side Platform),即需求方平台,根据曝光的上下文以及用户属性实时地评估曝光价值,并给出报价,出价最高的DSP胜出,赢得此次广告曝光机会。
1.png

比如,某应用作为广告交易平台的媒体,提供一个广告位,用户访问该媒体页面,即代表一次曝光机会,此时,多家需求方平台可以通过媒体提供的用户属性、使用场景、底价等信息进行报价竞拍,并在100毫秒内完成估价和出价,价高者中标后即可占用该广告位,并向用户展示。
通过实时竞价,无论是平台媒体,还是广告需求方,都可以实现曝光和收益最大化。
如何实现实时竞价

一、添加竞价参数

开发者需要在广告请求参数AdRequestParams中添加实时竞价相关参数。
  1. import { advertising } from '@kit.AdsKit';
  2. const adRequestParams: advertising.AdRequestParams = {
  3.   // 'testu7m3hc4gvm'为测试专用的广告位ID,暂无竞价信息,App正式发布时需要改为正式的广告位ID
  4.   adId: 'testu7m3hc4gvm',
  5.   // 广告类型
  6.   adType: 3,
  7.   // 交易的最大超时时间
  8.   tMax: 100,
  9.   // 竞价请求支持的币种,多个用英文逗号分隔
  10.   cur: 'CNY',
  11.   // 竞价广告位的底价
  12.   bidFloor: 6.66,
  13.   // 竞价广告位底价使用的币种
  14.   bidFloorCur: 'CNY',
  15.   // 广告位竞投的APP包名,多个用英文逗号分隔
  16.   bpkgName: 'com.huawei.baidu,com.huawei.music'
  17. };
复制代码
二、处理竞价结果

开发者需要在广告请求成功后的回调AdLoadListener.onAdLoadSuccess或MultiSlotsAdLoadListener.onAdLoadSuccess中,处理广告返回的实时竞价结果Advertisement.biddingInfo。
  1. import { advertising } from '@kit.AdsKit';
  2. import { hilog } from '@kit.PerformanceAnalysisKit';
  3. import { rcp } from '@kit.RemoteCommunicationKit';
  4. interface BiddingInfo {
  5.   // 本条广告的eCPM(每一千次展示可以获得的广告收入)
  6.   price: number;
  7.   // 本条广告的价格币种
  8.   cur: string;
  9.   // 媒体回传竞价成功结果的URL
  10.   nurl: string;
  11.   // 媒体回传竞价失败结果的URL
  12.   lurl: string;
  13. }
  14. const adLoaderListener: advertising.AdLoadListener = {
  15.   // 广告请求失败回调
  16.   onAdLoadFailure: (errorCode: number, errorMsg: string) => {
  17.     hilog.error(0x0000, 'testTag', `Failed to load ad. Code is ${errorCode}, message is ${errorMsg}`);
  18.   },
  19.   // 广告请求成功回调
  20.   onAdLoadSuccess: (ads: Array) => {
  21.     hilog.info(0x0000, 'testTag', 'Succeeded in loading ad');
  22.     // 期望的底价
  23.     const bidFloor: number = 6;
  24.     const biddingSuccessAds: Array = [];
  25.     for (const ad of ads) {
  26.       const biddingInfo: BiddingInfo = ad.biddingInfo as BiddingInfo;
  27.       if (!biddingInfo) {
  28.         continue;
  29.       }
  30.       if (biddingInfo.cur === 'CNY' && biddingInfo.price >= bidFloor) {
  31.         hilog.info(0x0000, 'testTag', 'Petal Ads wins.');
  32.         if (biddingInfo.nurl) {
  33.           const url: string = biddingInfo.nurl
  34.             // 竞胜时,其他DSP最高出价
  35.             .replace('SECOND_PRICE', '3.6')
  36.             // 价格币种
  37.             .replace('AUCTION_CURRENCY', 'CNY');
  38.           sendBiddingResult(url);
  39.         }
  40.         biddingSuccessAds.push(ad);
  41.       } else {
  42.         hilog.info(0x0000, 'testTag', 'Petal Ads loses.');
  43.         if (biddingInfo.lurl) {
  44.           const url: string = biddingInfo.lurl
  45.             // 竞败时,其他DSP最高出价
  46.             .replace('AUCTION_PRICE', '3.6')
  47.             // 竞价结果
  48.             .replace('AUCTION_LOSS', '102')
  49.             // 价格币种
  50.             .replace('AUCTION_CURRENCY', 'CNY')
  51.             // 竞败时,竞胜DSP推广的App包名
  52.             .replace('AUCTION_APP_PKG', 'com.huawei.music')
  53.             // 竞败时,竞胜DSP推广的App名称
  54.             .replace('AUCTION_APP_NAME', 'music')
  55.             // 竞败时,竞胜DSP的编号
  56.             .replace('AUCTION_CP_ID', '100')
  57.           sendBiddingResult(url);
  58.         }
  59.       }
  60.     }
  61.     // ...此处省略展示广告的逻辑
  62.   }
  63. };
  64. async function sendBiddingResult(url: string): Promise<void> {
  65.   let session: rcp.Session | undefined = undefined;
  66.   try {
  67.     session = rcp.createSession();
  68.     await session.get(url);
  69.   } catch (e) {
  70.     hilog.error(0x0000, 'testTag', `Failed to send bidding result. Code is ${e.code}, message is ${e.message}`);
  71.   } finally {
  72.     session?.close();
  73.   }
  74. }
复制代码
这样,媒体平台就可以实现广告实时竞价的能力了。
当前,实时竞价能力支持的场景有原生广告、激励广告、插屏广告、开屏广告和贴片广告,通过广告实现了从用户唤醒到深度转化的全链路触达。未来,随着隐私计算与AI大模型的深度融合,实时竞价将进一步打破数据孤岛,在保护用户隐私的前提下,让每一次竞价都更具价值,持续引领数字营销向智能化、精细化迈进。
了解更多详情>>
访问广告服务联盟官网
获取实时竞价开发指导文档

来源:程序园用户自行投稿发布,如果侵权,请联系站长删除
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

相关推荐

您需要登录后才可以回帖 登录 | 立即注册