On a NextJS/ReactJS
project, I attempt setting up Google Optimize for some experiments.
What I want to avoid though is the flickering effect it has while Optimize is changing the visual elements on each experiment.
For this cause, I have used the anti-flicker script suggested by Google. Now, while this works on initial load, practically "hiding" the entire page for some time in order for Optimize to apply changes, this does not work on my case in terms of client-side routing, as the full reload of a page does not occur in that case.
Therefore, I "avoid" flickering on initial page load, but I have not managed to make it work in terms of client-side routing, as the initial script does not execute again - and even if it did, the result would not be ideal.
Please note that hiding and re-displaying the page is not an option (like re-initiating the script via a history change event), as this breaks the continuity client-side routing provides. Also, hiding temporarily the component that is flickered is not proven easy, as I am not sure at which step of the routing process should I hide it and I did not manage to make it be displayed in an effective way. Thoughts?
Thank you very much in advance.