Running google Optimize with a Frontity site


We’re trying to integrate Google Optimize to be able to run A/B-tests on our site. Today we load most 3rd party scripts using GTM but in this case we run into the issue that the optimize script is not loaded first resulting in that any user that is getting the “alternative version” of the site first get’s the original and then after a “flicker” the correct version is shown. This is not uncommon and Google has a solution for this; load their “anti flicker” script the first thing you do (almost). But how on earth do make that happen on a Frontity site? If I use React Helmet there is no telling when the script will be loaded and hence it does not work. So how can I get better control over the scripts that are loded in the section of the site using Frontity?

Or are there other/better ways this “flicker problem” can be fixed?

Googles documentation on “anti flicker”:

Install Optimize:

1 Like