What is Page Flicker?
When you make client-side customizations, users may see a flicker due to the brief amount of time it takes for the browser to load the customized page.
Recommended Solution
The preTag script below helps to prevent flicker by hiding the body of your website while the Demandbase tag and customization loads.
In addition to resolving the flicker, the preTag script also helps prevent delays with page load. The page becomes visible once the customization loads or the timeout you set on the script is reached. A best practice is to insert the preTag script at the top of the page for the customization to load as soon as possible.
Tip: The last 3000 variable in the script is the maximum time (in milliseconds) to hide the non-customized page. In this example, after 3 seconds, the non-customized page is shown if the customization does not load. A best practice is to set this variable to the maximum amount of perceived load time you want your site visitors to experience.
(function (d, b, a, s, e, hd) {
var t = b.createElement(a),
fs = b.getElementsByTagName(a)[0];
t.async = 1;
t.id = e;
t.src = s;
t.setAttribute('hidingTime', hd)
fs.parentNode.insertBefore(t, fs);
})
(window, document, 'script', 'https://tag.demandbase.com/pretag.min.js',
'demandbase_js_pretag_lib', 3000);