簡體   English   中英

Google 廣告單元 (DFP) 會在呈現廣告時顯示編號。 我應該如何隱藏那個號碼?

[英]Google ad units (DFP) shows number along with the ad on render. How should I hide that number?

有沒有辦法隱藏這個數字?

Google 廣告單元 (DFP) 會在呈現廣告時顯示編號。 我應該如何隱藏那個號碼? 所有的腳本是:

googletag.cmd.push(() => {
        googletag.defineSlot(
        this.props.elem.path,
        this.props.elem.size,
    this.props.elem.id,
    ).addService(googletag.pubads());
    googletag.pubads().enableSingleRequest();
    googletag.enableServices();
}

**Body :**
<div id={elem.id} style={{ width: elem.size[0], height: elem.size[1] }}>
    {
       googletag.cmd.push(() => {
           googletag.display(elem.id);
       })
    }
</div>

很簡單,只需創建一個新組件並添加以下代碼

componentDidMount() {
  googletag.cmd.push(() => {
    googletag.defineSlot(
      this.props.elem.path,
      this.props.elem.size,
      this.props.elem.id,
      ).addService(googletag.pubads());
    googletag.pubads().enableSingleRequest();
    googletag.enableServices();
  }
}

render() {
  <div id={elem.id} />
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM