To add a lazy load to your videos, you will need to follow the steps below.

Note: DON'T forget to change XXXXXXXXXXX with the appropriate details that you can find in your embed code.

Note #2: If you want to add a lazy load code to your ClickFunnels page, you will need to add two custom JS/HTML code elements and put the longer code in the first one and shorter code in the second one.

Paste this code where the embed code of the video should be pasted (video element, custom JS/HTML code element):

<div id="vidalytics_embed_XXXXXXXXXXXXXXX" style="width: 100%; position:relative; padding-top: 56.25%;"></div>

Paste this code after the opening <body> tag:

<script>
function loadVidalyticsEmbedCode() {
setTimeout(doLoadVidalyticsEmbedCode, 500);
}
function doLoadVidalyticsEmbedCode() {
(function (v, i, d, a, l, y, t, c, s) {
y='_'+d.toLowerCase();c=d+'L';if(!v[d]){v[d]={};}if(!v[c]){v[c]={};}if(!v[y]){v[y]={};}var vl='Loader',vli=v[y][vl],vsl=v[c][vl + 'Script'],vlf=v[c][vl + 'Loaded'],ve='Embed';
if (!vsl){vsl=function(u,cb){
if(t){cb();return;}s=i.createElement("script");s.type="text/javascript";s.async=1;s.src=u;
if(s.readyState){s.onreadystatechange=function(){if(s.readyState==="loaded"||s.readyState=="complete"){s.onreadystatechange=null;vlf=1;cb();}};}else{s.onload=function(){vlf=1;cb();};}
i.getElementsByTagName("head")[0].appendChild(s);
};}
vsl(l+'loader.min.js',function(){if(!vli){var vlc=v[c][vl];vli=new vlc();}vli.loadScript(l+'player.min.js',function(){var vec=v[d][ve];t=new vec();t.run(a);});});
})(window, document, 'Vidalytics', 'vidalytics_embed_XXXXXXXXXXXX', 'https://XXXXX.vidalytics.com/XXXXXXXX//XXXXXXXX//XXXXXXXXXXXX/');
}
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", loadVidalyticsEmbedCode);
} else {
loadVidalyticsEmbedCode();
}
</script>

Did this answer your question?