LiftIgniter Code Demo - no A|B test

HTML

<center><h1>
LiftIgniter<br> Recommendations
</h1></center>


<!--The Recommendation Area where items will be displayed-->
<div id="li-recommendation-unit">
  <div class='recommended_item li-widget-item'>
    <a class='headline' href='//url-1'>Title 1</a>
  </div>

  <div class='recommended_item li-widget-item'>
    <a class='headline' href='//url-2'>Title 1</a>
  </div>

  <div class='recommended_item li-widget-item'>
    <a class='headline' href='//url-3'>Title 3</a>
  </div>

  <div class='recommended_item li-widget-item'>
    <a class='headline' href='//url-4'>Title 4</a>
  </div>
</div>
<script type="application/mustache" id="recommended-item-template">
  <div class='recommended_item'>
    <a class='headline' href='{{url}}'>
      <div>{{title}}</div>
      <div><img src="{{thumbnail}}"></div>
    </a>
  </div>
</script>

CSS

#recommended-item-template {
  visibility: hidden;
}

img {
  max-width: 400px;
}

.recommended_item {
  margin: 15px;
}
.recommended_item {
border: 2px dashed  #ffffff;
box-shadow: 0 0 0 8px #a3a3a3;
}

JavaScript

//----------Widget Display Template------------


//---------- BEACON SNIPPET START------------
// The Beacon calls our JS SDK, which allows the usage of the other $p functions seen below. It also applies a first-party tracking cookie to identify unique users.

if (typeof $igniter_var === 'undefined') {
  // Ensures that our client code is updated.
  (function(w, d, s, p, v, e, r) {
    w.$ps = (w.performance && w.performance.now && 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/f7tsbsle43k5irci.js', '$p');
  // If you have a LiftIgniter account, you can replace "f7tsbsle43k5irci" with your own JS key to get recommendations from your own inventory. Make sure to replace it in the URL above, and in the $p("init") function below.

  $p("init", "f7tsbsle43k5irci");
  //This demo account only has 4 items in the inventory, so that is the maximum number of items it can return.
}
//---------- BEACON SNIPPET END------------

//---------- WIDGET CODE START------------

//-- 1. Define Rendering Area --
//$p('render') uses the Template defined in the HTML above to overwrite the Recommendation Area with the items recommended by LiftIgniter.
var rendering_callback = function(resp) {
  var els = document.querySelectorAll('#li-recommendation-unit > div.li-widget-item');
  var template = document.querySelector('#recommended-item-template').innerHTML;

  for (var i = 0; i < els.length && i < resp.items.length; ++i) {
    // Basically Mustache.render(template, resp.items[i]); 
    els[i].innerHTML = $p('render', template, resp.items[i]);
  }
}

//-- 2. Define Items to be Tracked...