Amp html 从<;中剥离rtc配置参数;amp ad>;标签

Amp html 从<;中剥离rtc配置参数;amp ad>;标签,amp-html,Amp Html,我们希望通过AMP ads实现报头竞价,但是我们的rtc config参数不断被删除。 下面是一个例子: $adcode = '<div class="ad"><amp-ad width=300 height=250 type="doubleclick" data-slot="'. esc_attr( $ad_slot ) .'" rtc-config=\'{ "vendor

我们希望通过AMP ads实现报头竞价,但是我们的
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;
$adcode='1
json=“”.esc_attr(wp_json_encode($json_targeting))。”>
';
返回$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>

... 

为什么会发生这种情况?

我看到的唯一错误是您在错误的位置关闭了

该错误放置的关闭不应导致标记保持其rtc配置参数不变

在第六行检查此代码

$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;
$adcode='1
';
返回$adcode;