I just tried to turn off an experiment while I was debugging something by setting the % to zero and got this rather contradictory error
Uncaught Error: failed to build: amp-experiment#6: Invalid percentage expViewability:0. Has to be in range of (0,100)โโโ _reported_
<amp-experiment>
<script type="application/json">
{
"aExperiment": {
"sticky":false,
"variants":{
"expViewability":0,
"expStd":100
}
}
}
</script>
</amp-experiment>
/ to @lannka
@jpettitt this is as intended. the error message is explaining: we don't allow variant with 0 traffic.
In your case, you should just remove the experiment. There's no point to keep it there to waste CPU cycles and bandwidth to load and run the code.
Please let me know if you have objection.
The it should say Has to be in range of (1,100)โโโ not Has to be in range of (0,100)โโโ
not Has to be in range of (0,100)โโโ
That's math notation. We could be more explicit with "greater than 0 and less than 100".
+1. Let's do it more explicitly.
looks like the error message was updated in #4871, but docs still:
A name-to-percentage map where percentage is a float number in range (0, 100) that indicates the amount of traffic will be allocated to the variant.
https://www.ampproject.org/docs/reference/components/amp-experiment
The notation (a, b) implies a < x < b see intervals. Admittedly (0,100) is confusing at first (it got me, I originally this issue) but it is the correct notation (ISO 31-11). I'm going to re-open and assign to @bpaduch to see if she wants to make it clearer in the doc.
Most helpful comment
That's math notation. We could be more explicit with "greater than 0 and less than 100".