Vitrin Ürünleri
      Sepete Ekle
      T-Soft E-Ticaret Sistemleriyle Hazırlanmıştır.
      name: item.item_name, list_name: item.item_list_name, brand: item.item_brand, list_position: index + 1, quantity: item.quantity, price: item.price, } }), }); gtag('event', 'page_view', { 'ecomm_pagetype': 'cart', 'ecomm_totalvalue': cart.value || 0, 'ecomm_prodid': cart.items.map(function (e) { return e.item_id.toString(); }) || [] }); }) }, orderAddress: () => { TsoftAppsOrderAddressCallback(async function () { const cart = await GTAG_APP.getCartItems(); if (cart.items.length === 0) { return false; } if (GTAG_APP.params.GA4_TRACKING_ID) { gtag('config', GTAG_APP.params.GA4_TRACKING_ID, GTAG_APP.configs); } if (GTAG_APP.params.GTAG_TRACKING_ID) { GTAG_APP.configs['page_path'] = '/order/address'; gtag('config', GTAG_APP.params.GTAG_TRACKING_ID, GTAG_APP.configs); } // For Google Analytics 4 gtag('event', 'checkout_progress', { 'send_to': GTAG_APP.params.GA4_TRACKING_ID, 'items': cart.items, 'checkout_step': 2 }); // For Google Analytics 4 gtag("event", "add_shipping_info", { 'send_to': GTAG_APP.params.GA4_TRACKING_ID, ...cart }); // For Universal Analytics gtag('event', 'checkout_progress', { 'send_to': GTAG_APP.params.GTAG_TRACKING_ID, 'coupon': cart.coupon, 'items': cart.items.map((item, index) => { return { id: item.item_id, name: item.item_name, list_name: item.item_list_name, brand: item.item_brand, list_position: index + 1, quantity: item.quantity, price: item.price, } }), 'checkout_step': 2 }); gtag('event', 'page_view', { 'ecomm_pagetype': 'cart', 'ecomm_totalvalue': cart.total || 0, 'ecomm_prodid': cart.items.map(function (e) { return e.item_id.toString(); }) || [] }); }); }, orderPayment: () => { TsoftAppsOrderPaymentCallback(async function (params) { const cart = await GTAG_APP.getCartItems(); if (cart.items.length === 0) { return false; } if (GTAG_APP.params.GA4_TRACKING_ID) { gtag('config', GTAG_APP.params.GA4_TRACKING_ID, { ...GTAG_APP.configs, 'page_location': window.location.href }); } if (GTAG_APP.params.GTAG_TRACKING_ID) { gtag('config', GTAG_APP.params.GTAG_TRACKING_ID, { ...GTAG_APP.configs, 'page_path': '/order/payment' }); } // For Google Analytics 4 gtag('event', 'checkout_progress', { 'send_to': GTAG_APP.params.GA4_TRACKING_ID, 'items': cart.items, 'checkout_step': 3 }); // For Google Analytics 4 gtag("event", "add_payment_info", { 'send_to': GTAG_APP.params.GA4_TRACKING_ID, ...cart }); // For Universal Analytics gtag('event', 'checkout_progress', { 'send_to': GTAG_APP.params.GTAG_TRACKING_ID, 'coupon': cart.coupon, 'items': cart.items.map((item, index) => { return { id: item.item_id, name: item.item_name, list_name: item.item_list_name, brand: item.item_brand, list_position: index + 1, quantity: item.quantity, price: item.price, } }), 'checkout_step': 3 }); gtag('event', 'page_view', { 'ecomm_pagetype': 'cart', 'ecomm_totalvalue': cart.total || 0, 'ecomm_prodid': cart.items.map(function (e) { return e.item_id.toString(); }) || [] }); }) }, removeFromCart: () => { TSOFT_APPS.cart.callback.delete.push(function (params) { if (params.status && params?.deletedProduct?.id > 0) { gtag("event", "remove_from_cart", { currency: "USD", value: params.deletedProduct.total_price * params.deletedProduct.quantity, items: [ { item_id: params.deletedProduct.id, item_name: params.deletedProduct.name, index: 0, item_brand: params.deletedProduct.brand, price: params.deletedProduct.total_price, quantity: params.deletedProduct.quantity } ] }); } }) }, orderApprove: () => { TsoftAppsOrderApproveCallback(function (order) { let currency = order[GTAG_APP.params.GTAG_CURRENCY_TYPE] === 'TL' ? 'TRY' : order[GTAG_APP.params.GTAG_CURRENCY_TYPE]; const products = order.products.map((product, index) => { const price = GTAG_APP.params.GTAG_CURRENCY_TYPE === 'currency' ? (GTAG_APP.params.GTAG_WITH_VAT === '1' ? product.total_amount_order : product.amount_order) : (GTAG_APP.params.GTAG_WITH_VAT === '1' ? product.total_amount_store : product.amount_store); return { item_id: GTAG_APP.params.PRODUCT_TYPE === 'id' ? product.identifier : product.code, item_name: product.name, currency: currency, index: index, item_brand: product.brand, item_list_id: product.category_id, item_list_name: product.category_name, quantity: product.quantity, price: parseFloat(price.toFixed(2)), ...GTAG_APP.categoryTree(product.category_path + product.category_name) } }); let orderValue = GTAG_APP.params.GTAG_CURRENCY_TYPE === 'currency' ? (GTAG_APP.params.GTAG_WITH_VAT === '1' ? order.amount : order.amount_without_vat) : (GTAG_APP.params.GTAG_WITH_VAT === '1' ? order.amount_store : order.amount_without_vat); if (GTAG_APP.params.GA4_TRACKING_ID) { gtag('config', GTAG_APP.params.GA4_TRACKING_ID, { ...GTAG_APP.configs, 'page_location': window.location.href }); } if (GTAG_APP.params.GTAG_TRACKING_ID) { GTAG_APP.configs['page_path'] = '/order/approve'; gtag('config', GTAG_APP.params.GTAG_TRACKING_ID, GTAG_APP.configs); } gtag('event', 'page_view', { 'ecomm_pagetype': 'purchase', 'ecomm_totalvalue': orderValue.toFixed(2), 'ecomm_prodid': products.map(function (e) { return e.item_id.toString(); }) || [] }); // For Google Analytics 4 gtag("event", "purchase", { 'send_to': GTAG_APP.params.GA4_TRACKING_ID, 'transaction_id': order.transaction, 'value': parseFloat(orderValue.toFixed(2)), 'tax': parseFloat((order.total_vat).toFixed(2)), 'shipping': order.cargo_price, 'currency': GTAG_APP.currency, 'coupon': order.coupon, 'items': products }); // For Universal Analytics gtag('event', 'purchase', { 'send_to': GTAG_APP.params.GTAG_TRACKING_ID, 'transaction_id': order.transaction, 'value': parseFloat(orderValue.toFixed(2)), 'tax': parseFloat((order.total_vat).toFixed(2)), 'shipping': order.cargo_price, 'currency': GTAG_APP.currency, 'coupon': order.coupon, 'items': products.map((item, index) => { return { id: item.item_id, name: item.item_name, list_name: item.item_list_name, brand: item.item_brand, list_position: index + 1, quantity: item.quantity, price: parseFloat(item.price), } }) }); //For Track Ads conversions if (GTAG_APP.params.GTAG_ADWORDS_ID !== '') { gtag('event', 'conversion', { 'send_to': GTAG_APP.params.GTAG_ADWORDS_ID + '/' + GTAG_APP.params.GTAG_ADWORDS_LABEL, 'value': orderValue.toFixed(2), 'currency': currency, 'transaction_id': order.transaction }); } }); } } GTAG_APP.run(); Sepete Ekle
      T-Soft E-Ticaret Sistemleriyle Hazırlanmıştır.