Using Standard Embed Code for Multiple Videos

Incorrect Usage

A common mistake is using the Standard Embed Code for every video when embedding multiple videos on the same page.

For example, a page with three videos might use the following setup:

  • Video 1: Standard Embed Code
  • Video 2: Standard Embed Code
  • Video 3: Standard Embed Code

Why It's a Problem

Each Standard Embed Code loads additional files required by the Vidalytics player. Using it multiple times on the same page causes unnecessary downloads of these files, increasing network requests and potentially affecting page loading performance.

Use the Standard Embed Code only for the first video on the page. For the second video and all subsequent videos, use the Multiple Embed Code.

The correct setup should look like this:

  • Video 1: Standard Embed Code
  • Video 2: Multiple Embed Code
  • Video 3: Multiple Embed Code

To get the Multiple Embed Code, open the Embed Code popup and enable the Multiple Videos on One Page checkbox before copying the code: How To Get the Multiple Embed Code

Standard Embed Code (first video):

<div id="vidalytics_embed_WoPIIkK7tcX42doH" style="width: 100%; position:relative; padding-top: 56.25%;"></div>
<script type="text/javascript">
(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_WoPIIkK7tcX42doH', 'https://quick.vidalytics.com/embeds/sXFEYTDU/WoPIIkK7tcX42doH/');
</script>

Multiple Embed Code (second and subsequent videos):

<div id="5LI9f8OC1bFDzl9W" style="width: 100%; position:relative; padding-top: 56.25%;"></div>
<script type="text/javascript">
    (function (v, i, d, a, l, y, t, c, s) {
        y='_'+d.toLowerCase();if(!v[y]){v[y]={}}if(!v[y].embeds){v[y].embeds={}}
        t=function(){if(v[d]&&v[d].Embed){var ve=v[d].Embed;c=new ve();c.run(a);c.loadCss();}else{setTimeout(t,1000)}};s=new XMLHttpRequest();s.open("GET",l+'?ac='+(new Date()).getTime(),true);
        s.onreadystatechange=function(){if(s.readyState==4){if((s.status==200||s.status==304)){var sd=JSON.parse(s.responseText);v[y].embeds[a]={type:"video",options: sd};t();}}};s.send();
    })(window, document, 'Vidalytics', '5LI9f8OC1bFDzl9W', 'https://quick.vidalytics.com/embeds/sXFEYTDU/5LI9f8OC1bFDzl9W/player.settings.json');
</script>

This prevents unnecessary file downloads and helps optimize page loading performance.