Skip to content
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.

Google optimize flicker #741

Merged
merged 1 commit into from
Apr 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/helpers/Html.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ const Html = ({ store, component, assets }) => {
</head>
<body>
<div id="app" dangerouslySetInnerHTML={{ __html: content }} />
<style
dangerouslySetInnerHTML={{
__html: '.async-hide { opacity: 0 !important}'
}}
/>
<script
dangerouslySetInnerHTML={{
__html: `(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-PNMFTW3':true});`
}}
/>
<script
dangerouslySetInnerHTML={{
__html: `(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
Expand Down