All Collections
Vidalytics Code Customizations
Adding Lazy Load to Your Videos
Adding Lazy Load to Your Videos

How to Add Lazy Load to Videos

Erika Lehmann avatar
Written by Erika Lehmann
Updated over a week ago

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:

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){
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();;});});
})(window, document, 'Vidalytics', 'vidalytics_embed_XXXXXXXXXXXX', '');
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", loadVidalyticsEmbedCode);
} else {

Did this answer your question?