nostoTrackAddToCart = function(product, list) {
'event': 'nostoAddToCart',
'add': { // 'add' actionFieldObject measures.
'products': [{ // adding a product to a shopping cart.
nostoTrackRecoClick = function(product, list) {
'event': 'nostoProductClick',
'actionField': {'list': list}, // Optional list property.
'name': product.name, // Name or ID is required.
'position': product.position
'eventCallback': function() {
api.listen("postrender", function(postRenderElements){
if (typeof nostoGtmQueue != "undefined" && nostoGtmQueue != null && typeof nostoGtmQueue == "function" && typeof nostoGtmQueue.q == "object" ) {
for (i = 0; i < nostoGtmQueue.q.length; i++) {
var slotQueue = nostoGtmQueue.q[i];
if (slotQueue.impressions != null && typeof slotQueue.impressions == "object") {
for (x = 0; x < slotQueue.impressions.length; x++) {
var product = slotQueue.impressions[x];
product.list = slotQueue.listName;
impressions.push(product);
if (typeof nostoCurrency != "undefined" && nostoCurrency != null) {
currency = nostoCurrency;
'currencyCode' : currency,
'impressions': impressions
'event': 'nostoEcomImpression'
dataLayer.push(nostoEcomData);