【发布时间】:2021-01-14 07:43:21
【问题描述】:
我正在尝试设置新元素的 html 内容,但是当我检查 slot.getHtml() 是否为我提供了 html 元素(设置如下)时,它显示一个空字符串。知道为什么会发生这种情况吗?
var slot = googletag.defineSlot('/1234567/sports', [160, 600], 'ozge')
.addService(googletag.companionAds())
.addService(googletag.pubads())
.addService(googletag.content());
googletag.content().setContent(slot, '<h2>Custom content in ad slot.</h2>')
我用这个链接里的代码sn-p查看新定义的slot:https://gist.github.com/rdillmanCN/a70ec955d9a982127fefadabe8b898b5
【问题讨论】:
标签: javascript google-ads-api gpt google-publisher-tag