Sırala
Görünüm:
1.224,00 TL
Toplam 30 ürün görüntüleniyor.
', GTAG_ADWORDS_LABEL: '', GTAG_WITH_VAT: '1', PRODUCT_TYPE: 'id', // id or code OPTIMIZE_ID: '', GTAG_CURRENCY_TYPE: 'currency', SEND_MEMBER: 'true', }, setParams: () => { for (const [key, value] of Object.entries(GTAG_APP.params)) { GTAG_APP.params[key] = value === '{{' + key + '}}' || value === '' ? '' : value; } }, run: () => { GTAG_APP.setParams(); window.dataLayer = window.dataLayer || []; gtag('js', new Date()); if (window.MEMBER_INFO.ID > 0) { GTAG_APP.configs.user_id = window.MEMBER_INFO.ID; } if (!(['address', 'payment', 'approve'].includes(window.PAGE_TYPE))) { if (GTAG_APP.params.GA4_TRACKING_ID) { gtag('config', GTAG_APP.params.GA4_TRACKING_ID, { ...GTAG_APP.configs, 'optimize_id': GTAG_APP.params.OPTIMIZE_ID, }); } if (GTAG_APP.params.GTAG_TRACKING_ID) { gtag('config', GTAG_APP.params.GTAG_TRACKING_ID, GTAG_APP.configs); } } if (GTAG_APP.params.GTAG_ADWORDS_ID) { gtag('config', GTAG_APP.params.GTAG_ADWORDS_ID, window.MEMBER_INFO.ID > 0 ? {'allow_enhanced_conversions': true} : {}); } if (GTAG_APP.params.SEND_MEMBER === 'true') { GTAG_APP.setUserData(); } GTAG_APP.productDetail() GTAG_APP.pageview(); GTAG_APP.pageCategory() GTAG_APP.dynamicLoader(); GTAG_APP.addToCart() GTAG_APP.wishList() GTAG_APP.login() GTAG_APP.register() GTAG_APP.orderApprove() GTAG_APP.pageCart() GTAG_APP.orderAddress() GTAG_APP.orderPayment() GTAG_APP.removeFromCart(); }, categoryTree: (categoryPath) => { categoryPath = categoryPath.split(' > '); if (categoryPath[categoryPath.length - 1] === '') { delete categoryPath[categoryPath.length - 1]; } let categoryTree = []; categoryPath.forEach((category, index) => { categoryTree['item_category' + (index === 0 ? '' : index + 1)] = category; }); return categoryTree; }, setUserData: () => { if (window.MEMBER_INFO.MAIL !== '') { gtag('set', 'user_data', { 'email': window.MEMBER_INFO.MAIL, 'address': { 'first_name': window.MEMBER_INFO.FIRST_NAME, 'last_name': window.MEMBER_INFO.LAST_NAME, 'city': window.MEMBER_INFO.MEMBER_CITY, 'country': window.MEMBER_INFO.MEMBER_COUNTRY, 'postal_code': window.MEMBER_INFO.MEMBER_ZIP_CODE, } }) } }, pageview: () => { TSOFT_APPS.page.home.callback.push(function () { gtag('event', 'page_view', { 'ecomm_pagetype': 'home', }); }) TSOFT_APPS.page.other.callback.push(function () { gtag('event', 'page_view', { 'ecomm_pagetype': 'other', }); }) TSOFT_APPS.page.search.callback.push((searchWord, product) => { gtag('event', 'page_view', { 'ecomm_pagetype': 'searchresults', }); }) if (window.PAGE_TYPE === "brand") { gtag('event', 'page_view', { 'ecomm_pagetype': 'brand', }); } }, getCartItems: async () => { await TSOFT_APPS.get.cart.load(); const cartLoad = await TSOFT_APPS.get.result.cart.load; const products = cartLoad.PRODUCTS.map((product, index) => { return { item_id: GTAG_APP.params.PRODUCT_TYPE === 'id' ? product.ID : product.PRODUCT_CODE, item_name: product.TITLE, currency: product.TARGET_CURRENCY === 'TL' ? 'TRY' : product.TARGET_CURRENCY, index: index, item_brand: product.BRAND, item_list_id: product.CATEGORY_ID, item_list_name: product.CATEGORY_NAME, price: (product.PRICE_TOTAL / product.COUNT).toFixed(2), quantity: product.COUNT, ...GTAG_APP.categoryTree(product.CATEGORY_PATH + product.CATEGORY_NAME), } }); const cart = { items: products, value: cartLoad.PRICE_CART, coupon: cartLoad.COUPON_CODE, currency: cartLoad.TARGET_CURRENCY === 'TL' ? 'TRY' : cartLoad.TARGET_CURRENCY, } return cart; }, productDetail: () => { TSOFT_APPS.product.detail.callback.push(function () { const productData = PRODUCT_DATA[0]; // For Google Analytics 4 gtag("event", "view_item", { 'send_to': GTAG_APP.params.GA4_TRACKING_ID, "currency": productData.currency === 'TL' ? 'TRY' : productData.currency, "value": productData.total_sale_price, "items": [ { "item_id": productData[GTAG_APP.params.PRODUCT_TYPE], "item_name": productData.name, "currency": productData.currency === 'TL' ? 'TRY' : productData.currency, "index": 0, "item_brand": productData.brand, "item_list_id": productData.category_id, "item_list_name": productData.category, "price": productData.total_sale_price, "quantity": productData.quantity, ...GTAG_APP.categoryTree(productData.category_path + productData.category), } ] }); // For Google Universal Analytics gtag('event', 'view_item', { 'send_to': GTAG_APP.params.GTAG_TRACKING_ID, "items": [ { "id": productData[GTAG_APP.params.PRODUCT_TYPE], "name": productData.name, "list_name": productData.category, "brand": productData.brand, "category": (productData.category_path + productData.category).replace(/ > /g, '/'), "quantity": productData.quantity, "currency": productData.currency === 'TL' ? 'TRY' : productData.currency, "price": productData.total_sale_price, "list_position": 1, } ] }); gtag('event', 'page_view', { 'ecomm_pagetype': 'product', 'ecomm_totalvalue': productData.total_sale_price, 'ecomm_prodid': productData[GTAG_APP.params.PRODUCT_TYPE], 'ecomm_category': (productData.category_path + productData.category).replace(/ > /g, '/'), }); }) }, pageCategory: () => { TSOFT_APPS.page.category.callback.push((category, products) => { //For Google Analytics 4 gtag('event', 'view_item_list', { 'send_to': GTAG_APP.params.GA4_TRACKING_ID, 'items': products.slice(0, 200).map((product, index) => { return { item_id: product[GTAG_APP.params.PRODUCT_TYPE], item_name: product.name, currency: product.currency === 'TL' ? 'TRY' : product.currency, index: index, item_brand: product.brand, item_list_id: product.category_id, item_list_name: (product.category_path + product.category).replace(/ > /g, '/'), price: product.total_sale_price, ...GTAG_APP.categoryTree(product.category_path + product.category), } }), 'item_list_name': category.name, 'item_list_id': category.id }); // For Universal Analytics gtag('event', 'view_item_list', { 'send_to': GTAG_APP.params.GTAG_TRACKING_ID, 'items': products.slice(0, 200).map((product, index) => { return { id: product[GTAG_APP.params.PRODUCT_TYPE], name: product.name, list_name: product.category, brand: product.brand, category: (product.category_path + product.category).replace(/ > /g, '/'), list_position: index + 1, quantity: product.quantity, price: product.total_sale_price, } }), }); gtag('event', 'page_view', { 'ecomm_pagetype': 'category', 'ecomm_category': CATEGORY_DATA.name }); }); }, dynamicLoader: () => { TSOFT_APPS.product.dynamicLoader.push(function (products) { gtag('event', 'view_item_list', { 'send_to': GTAG_APP.params.GTAG_TRACKING_ID, 'items': products.slice(0, 200).map((product, index) => { return { id: product[GTAG_APP.params.PRODUCT_TYPE], name: product.name, list_name: product.category, brand: product.brand, category: (product.category_path + product.category).replace(/ > /g, '/'), list_position: index + 1, quantity: product.quantity, price: product.total_sale_price, } }), }); }); }, addToCart: () => { TSOFT_APPS.cart.callback.add.push(function (r) { if (([-1, 0].includes(r.status))) { return false; } let addedProduct = Array.isArray(r) ? r[0].addedProduct : r.addedProduct; // For Google Analytics 4 gtag("event", "add_to_cart", { 'send_to': GTAG_APP.params.GA4_TRACKING_ID, 'currency': GTAG_APP.currency, 'value': parseFloat(addedProduct.price).toFixed(2), 'items': [ { 'item_id': addedProduct[GTAG_APP.params.PRODUCT_TYPE], 'item_name': addedProduct.name, 'currency': window.CURRENCY === 'TL' ? 'TRY' : window.CURRENCY, 'index': 0, 'item_brand': addedProduct.brand, 'item_list_name': addedProduct.category, 'price': parseFloat(addedProduct.price).toFixed(2), 'quantity': addedProduct.quantity, ...GTAG_APP.categoryTree(addedProduct.category_path + addedProduct.category), } ] }); //For Universal Analytics gtag('event', 'add_to_cart', { 'send_to': GTAG_APP.params.GTAG_TRACKING_ID, items: [ { id: addedProduct[GTAG_APP.params.PRODUCT_TYPE], name: addedProduct.name, list_name: addedProduct.category, brand: addedProduct.brand, category: (addedProduct.category_path + addedProduct.category).replace(/ > /g, '/'), quantity: addedProduct.quantity, price: parseFloat(addedProduct.price).toFixed(2), list_position: 1, variant: addedProduct.variant, } ], }); }) }, wishList: () => { TSOFT_APPS.product.wishList.callback.add.push(function (r) { if (r.status) { let product = r.data; // For Google Analytics 4 gtag("event", "add_to_wishlist", { 'send_to': GTAG_APP.params.GA4_TRACKING_ID, 'currency': GTAG_APP.currency, 'value': parseFloat(product.price).toFixed(2), 'items': [ { item_id: product[GTAG_APP.params.PRODUCT_TYPE], item_name: product.name, currency: GTAG_APP.currency, index: 0, item_list_name: product.category_name, quantity: 1, price: parseFloat(product.price).toFixed(2), ...GTAG_APP.categoryTree((product.category_path + product.category_name) || '') } ], }); // For Universal Analytics // Does not support items in add_to_wishlist event gtag('event', 'add_to_wishlist', { 'send_to': GTAG_APP.params.GTAG_TRACKING_ID, }); } }) }, login: () => { TSOFT_APPS.page.tracking.login.callback.push(function (params) { gtag("event", "login", {}); }) }, register: () => { TSOFT_APPS.page.tracking.sign.callback.push(function (params) { if ([1, 2].includes(params.status)) { gtag("event", "sign_up", {}); } }) }, pageCart: () => { TSOFT_APPS.page.cart.callback.push(async function (data) { const cart = await GTAG_APP.getCartItems(); if (cart.items.length === 0) { return false; } // For Google Analytics 4 gtag("event", "begin_checkout", { ...cart, 'send_to': GTAG_APP.params.GA4_TRACKING_ID, }); // For Universal Analytics gtag('event', 'begin_checkout', { '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, } }), }); 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();
T-Soft E-Ticaret Sistemleriyle Hazırlanmıştır.