if(typeof ps_page == 'undefined')
{
var ps_page='notsetyet'
}
if ( ps_page=='home')
{
var track ='homepage';
var basketPrice = 'Home';
var arr = 'notset';
var ct='product';
}
else if (ps_page=='list')
{
var track ='category';
var basketPrice = $.trim($(document).find("title").text());
var arr = 'notset';
var ct='product';
}
else if (ps_page=='show')
{
var proVal = document.querySelector('meta[property="product:price:amount"]').content;
if(proVal>1)
{
var track ='ViewContent';
var basketPrice = proVal;
var arr = ps_pid;
var ct='product';
}
}
else if (ps_page=='search')
{
var track ='Search';
var basketPrice = ps_search_text;
var arr = 'not_set';
var ct='product';
}
var urlParams = new URLSearchParams(window.location.search);
if (urlParams.get('p')=='showcustomerbasket' || window.location.href.toString().split(window.location.host)[1]=='/sepetimigoster.html')
{
var basketPrice = json_basket_value.general_price
var arr = [];
$.each(json_basket_value.product_array,function(i,e){arr.push(e.id);});
var track ='AddToCart';
var ct='product';
}
if (urlParams.get('p')=='dopayment')
{
var basketPrice = json_basket_value.general_price
var arr = [];
$.each(json_basket_value.product_array,function(i,e){arr.push(e.id);});
var track ='AddPaymentInfo';
var ct='product';
}
if (urlParams.get('operation')=='successpage')
{
var basketPrice = json_basket_value.total_price;
var arr = [];
$.each(json_basket_value.product_array,function(i,e){arr.push(e.id);});
var track ='Purchase';
var ct='product';
}