Edit in JSFiddle

// The usual commands to identify visitors and report cart contents.
ScarabQueue.push(['setEmail', 'visitor@test-mail.com']);
ScarabQueue.push(['cart', [
    {item: 'item_1', price: 19.9, quantity: 1},
    {item: 'item_2', price: 29.7, quantity: 3}

// Passing on item ID to report product view. Item ID should match the value listed in the Product Catalog
ScarabQueue.push(['view', 'item_3']);

// Firing the ScarabQueue. Should be the last call on the page, called only once.

// You can easily test how this works. Just replace the demo Merchant ID with your own.
// Log into your Predict Dashboard, click LIVE EVENTS, and on the event screen select 'my visit' from the dropdown. 
// Hit Run in JSFiddle. Refresh Live Events and you should see the View event reported with the above value.
<!-- Parts of our JavaScript API to implement on Product Pages -->

<!-- Header code. Loads the scarab-v2.js and identifies the merchant account (here the emarsys demo merchant 1A65B5CB868AFF1E). Replace it with your own Merchant ID before hitting 'Run' -->
var ScarabQueue = ScarabQueue || [];
(function(subdomain, id) {
  if (document.getElementById(id)) return;
  var js = document.createElement('script'); js.id = id;
  js.src = subdomain + '.scarabresearch.com/js/1A65B5CB868AFF1E/scarab-v2.js';
  var fs = document.getElementsByTagName('script')[0];
  fs.parentNode.insertBefore(js, fs);
})('https:' == document.location.protocol ? 'https://recommender' : 'http://cdn', 'scarab-js-api');