"> '); gtag('set', {'currency' : 'usd'}); gtag('event', 'screen_view', {'screen_name' : 'Papers & Sketchbooks'}); nsc('.add-to-basket').click(function() { var nQuantity = '1'; var bHasId = false; var sId = ''; var sProductId = ''; $(this).each(function() { $.each(this.attributes, function() { if(this.name == 'id') { bHasId = true; } }); }); if (bHasId) { sId = (nsc(this).attr('id')).split('-') ; } else { if (typeof nsc(this).parent().parent().find(".add-to-list").attr('id') != 'undefined') { sId = (nsc(this).parent().parent().find(".add-to-list").attr('id')).split('-'); } } if (sId != '') { sProductId = sId[sId.length - 1]; gtag('event', 'add_to_cart', {'items' : {'id' : sProductId, 'quantity' : nQuantity}}); } }); nsc('.add-to-list, .add-to-registry').click(function() { var sId = (nsc(this).attr('id')).split('-') ; var sProductId = sId[sId.length - 1]; var nQuantity = '1'; gtag('event', 'add_to_wishlist', {'items' : {'id' : sProductId, 'quantity' : nQuantity}}); }); nsc('#login-button').click(function() { gtag('event', 'login', {'method' : 'webstore_account'}); }); });