Optimize code
-
Hi,
I am trying to install the Optimize codes in the plugin. I use Universal Analytics.
I add the following to Custom GA Code:
ga(‘require’, ‘GTM-XXXXXXX’); with XXXXX being my container number.I add the following to my Custom Code (anti flicker):
<style>.async-hide { opacity: 0 !important} </style>
<script>(function(a,s,y,n,c,h,i,d,e){s.className+=’ ‘+y;h.start=1*new Date;
h.end=i=function(){s.className=s.className.replace(RegExp(‘ ?’+y),”)};
(a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c;
})(window,document.documentElement,’async-hide’,’dataLayer’,4000,
{‘GTM-XXXXXX’:true});</script>I get the following error when doing dignostics:
Errors
Optimize plugin not found
The web page page doesn’t have Optimize plugin for the container ID (GTM-PNGBM63) installed. You can still use the visual editor to create variants but you can’t use Preview mode to test them and visitors won’t see your experiment. To run an experiment you must first install Optimize .Warnings
The anti-flicker snippet timed out
The anti-flicker snippet might not have been configured correctly or the timeout value is too short. The anti-flicker timeout is a worst-case scenario. Your page will only be hidden for the full timeout if the experiment cannot execute sooner (and when it does, the page is unhidden immediately). When anti-flicker times out, your experiment doesn’t run on that page load, which can limit the efficacy of your experiment and results. Regardless of timeout value, ensure that the Optimize plugin is deployed correctly and not late in the page (e.g. in the <BODY>).What am I doing wrong?
- The topic ‘Optimize code’ is closed to new replies.