Lazy-loading widgets is a common practice to minimize API calls for low-visibility widgets, such as those that appear near the footer of your pages. The default behavior of the $p("fetch") function does not support lazy-loading, so you will need to enable a special config via the $p("init") function. 


Enabling multiFetch


The $p("init") function has many configuration options available. For multiFetch, you'll need to add the following to your beacon snippet:


var customConfig = {
  sdk: {
    multiFetch: true
  }
}


When $p("init") is called, make sure to include the customConfig argument in order to have multiFetch enabled.


Full Beacon Snippet Example

<script type="text/javascript">
if (typeof $igniter_var === 'undefined') {
  (function(w,d,s,p,v,e,r) {w.$ps = (w.performance &amp;amp;&amp;amp; w.performance.now &amp;amp;&amp;amp; typeof(w.performance.now)
   == "function") ? w.performance.now() : undefined;w['$igniter_var']=v;w[v]=w[v]||function(){(w[v].q=w[v].q||[]).push(
  arguments)};w[v].l=1*new Date();e=d.createElement(s),r=d.getElementsByTagName(s)[0];e.async=1;
  e.src=p+'?ts='+(+new Date()/3600000|0);
  r.parentNode.insertBefore(e,r)})(window,document,'script','//cdn.petametrics.com/YOUR_JS_KEY.js','$p');

var customConfig = {
  sdk: {
    multiFetch: true
  }
}

  $p("init", "YOUR_JS_KEY", customConfig);
  $p("send", "pageview");
}
</script>