我想把查询参数传递给一个"doubleclick“类型的amp-ad标签。我已经阅读了这里的目标信息:https://www.ampproject.org/docs/reference/components/amp-ad
这个链接跟我认为双击应该怎么做有关:
https://github.com/ampproject/amphtml/blob/master/extensions/amp-a4a/rtc-documentation.md
我不清楚该如何传递查询字符串中的参数。我注意到还有其他的AMP标签可以有一个在渲染时替换的QUERY_PARAM,但是amp-ad标签似乎不是这样的。
我正在尝试这样的东西:
<amp-ad width=300 height=250
type="doubleclick"
data-slot="/slot_id/ad_unit_id"
json="{'targeting':{ 'utm_source':[QUERY_PARAM(utm_source)]}}">
是否有其他方法可以将具有查询字符串中的值的键值对传递给DFP?
发布于 2018-09-28 16:12:26
你可以用PHP做到这一点:
if (isset($_GET['utm_source'])) {
$utm_source = '["'.$_GET['utm_source'].'"]';
}
echo '<amp-ad width=300 height=250
type="doubleclick"
data-slot="/slot_id/ad_unit_id"
json="{'targeting':{ 'utm_source':'.$utm_source.'}}">';https://stackoverflow.com/questions/52543769
复制相似问题