var items = [], products = [{"id":12932,"article":"00000013959\/","brand_title":"MiaMi","title":"Чехол MiaMI Crystal Xiaomi Redmi Note 9 4G","price":69,"url":"https:\/\/clicker.store\/chekhol-miami-crystal-xiaomi-redmi-note-9-4g\/","category_string":"Xiaomi\/Xiaomi Redmi Note-серия\/Xiaomi Redmi Note 9 4G<\/b>","article_for_display":"00000013959\/"}], ids = [], total = 0, productsPerEvent = 5, sendEvent = function(items, ids, total) { gtag('event', 'view_item_list', { "items": items, "transport_type": 'xhr', 'ecomm_prodid' : ids, 'ecomm_pagetype' : 'category', 'ecomm_totalvalue': total }); }; for (var i = 0, l = products.length; i < l; ++i) { var product = products[i]; items.push({ 'id' : product.article, 'name' : product.title, 'category' : product.category_string, 'brand' : product.brand_title, 'list' : 'Catalog Page', 'list_position': i + 1 }); ids.push(product.article); total = total + product.price; if (items.length === productsPerEvent) { sendEvent(items, ids, total); items = []; ids = []; total = 0; } } if (items.length > 0) { sendEvent(items, ids, total); }
0
Мой заказ
  • Цвет
    В желания
    Войдите на сайт чтобы
    добавить товар в список желаний