【发布时间】:2017-07-17 00:10:12
【问题描述】:
我正在尝试使用 amp-experiment 实施 a/b 测试。
.html 文件:
<amp-experiment>
<script type="application/json">
{
"a-experiment": {
"variants": {
"control": 50,
"1": 50
}
}
}
</script>
</amp-experiment>
<h3 class="a-experiment control">Sample control offer</h3>
<h3 class="a-experiment variant">Sample variant offer</h3>
.scss 文件:
body .control {
display: block;
}
body {
&[amp-x-a-experiment="control"] .variant {
display: none;
}
&[amp-x-a-experiment="1"] .control {
display: none;
}
}
除非用户启用了 uBlock Origin,否则它可以正常工作。这里有两个问题:
- 提供两种变体,
- 加载页面需要 4-5 秒。
有2个错误信息:
立即错误消息:
GET https://cdn.ampproject.org/v0/amp-analytics-0.1.js net::ERR_BLOCKED_BY_CLIENT页面加载后错误消息:
Render timeout waiting for service variant to be ready.
如果我删除 amp-experiment,uBlock 就没有问题。
还有其他人遇到过这个问题吗?有解决办法吗?
【问题讨论】:
-
我无法重现此问题。我已经检查了这个页面:ampbyexample.com/components/amp-experiment 并且安装了 uBlock Origin 后一切正常。是否有其他东西在干扰?
-
嗯...这很奇怪。当我转到:ampbyexample.com/components/amp-experiment 启用 uBlock 时,我遇到了相同的页面加载问题。需要 4-5 秒。然后当我检查 devTools 时,我看到了同样的错误。您在测试之前安装了 uBlock 吗?我们发现 uBlock 至少需要 30 分钟才能工作。
-
uBlock 正在阻止 amp-analytics。这是一个已知的问题?有办法解决吗?
-
是的 - 我可以重现该问题。我等的时间不够长。
标签: amp-html