我们正在寻找实现与AMP广告的标题竞价,但我们的rtc-config参数不断被剥离。下面是一个例子:
$adcode = '<div class="ad"><amp-ad width=300 height=250
type="doubleclick"
data-slot="'. esc_attr( $ad_slot ) .'"
rtc-config=\'{
"vendors": {
"aps": {"PUB_ID": "xxxx","PARAMS":{"amp":"1"}} }}\'>
json="' . esc_attr( wp_json_encode( $json_targeting ) ) . '">
</amp-ad></div>';
return $adcode;输出时,返回以下内容:
<amp-ad width="300" height="250" type="doubleclick" data-slot="xxxx/ab.m/story" json="{...}" class="i-amphtml-element i-amphtml-layout-fixed i-amphtml-layout-size-defined i-amphtml-layout" style="width: 300px; height: 250px;" data-amp-slot-index="0" data-a4a-upgrade-type="amp-ad-network-doubleclick-impl" data-google-query-id="xxxx">
... </amp-ad>为什么会发生这种情况?
发布于 2018-10-05 05:26:24
我看到的唯一错误的地方是你把<amp-ad>放在了错误的地方。
这个错误的闭合应该不会导致标记在其rtc-config参数的最后。
检查第六行的代码。
$adcode = '<div class="ad"><amp-ad width=300 height=250
type="doubleclick"
data-slot="'. esc_attr( $ad_slot ) .'"
rtc-config=\'{
"vendors": {
"aps": {"PUB_ID": "xxxx","PARAMS":{"amp":"1"}} }}\'
json="' . esc_attr( wp_json_encode( $json_targeting ) ) . '">
</amp-ad></div>';
return $adcode;https://stackoverflow.com/questions/52611437
复制相似问题