Support for Google Optimize Anti-Flicker Snippet in gatsby-plugin-google-gtag #24121
Unanswered
joelwilsonmt
asked this question in
Ideas / Feature Requests
Replies: 1 comment
-
For best performance, the snippet that loads the Optimize plugin (whether it's Analytics, Tag Manager, or gtag.js) should be installed in the element of your web page, immediately after the anti-flicker snippet . The Deploy Optimize help center article and tagging best practices section contain more information on the best way to install Optimize. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
When using gatsby-plugin-google-gtag it would be nice to have the google optimize anti-flicker snippet added to the top of the document as per Google's installation guidelines
Basic example
Change the gatsby-ssr.js file to include the above snippet (CSS and JS), which can then be passed to
setComponents()
on line 79. I don't know if this will place the snippet in the right place - for example if using React Helmet, will it place it top-most in the<head>
of the document?Motivation
To be able to have out-of-the-box support for the Google Optimize Anti-flicker snippet. At the moment Optimize Experiences are delivered with a screen flicker as elements are replaced on the page as the page loads.
Beta Was this translation helpful? Give feedback.
All reactions