I am trying to create a redirect test for an AMP page using Google Optimize. Normally to install Google Optimize on the page you would use something like this:
<script src="https://www.googleoptimize.com/optimize.js?id=OPT-'some ID'"></script>
Unfortunately, this script tag is not compatible with AMP. What can I do instead?
On AMP websites, this doesn't work because you have to keep the AMP guidelines in mind. Look into
<amp-analytics>
and<amp-experiment>
components to use Google Optimize on AMP sites. The support item Measure AMP experiments with Optimize gives you information about the configuration.