PageSourceSearch

https://www.borderstates.com/_ui/responsive/common/js/acc.gtm.js

js borderstates.com collected 2026-10-03 21:42:20 UTC 7,323 bytes, 149 lines download raw bytes

1ACC.gtm = {
2    _autoload: [ "bindTrackItem" ],
3    bindTrackItem: function ()
4    {
5        $(".product-item > .thumb, .item > a > .thumb, .carousel__item--thumb, .thumb.js-product-link, .name.js-product-link, .recently-viewed-item .thumb, .recently-viewed-item .name").on("click", function ()
6        {
7            var productCode =  $(this).data("productCode");
8            var productName =  $(this).data("productName");
9            var productPrice =  $(this).data("productPrice");
10            var productManufacturerData =  $(this).data("productManufacturerData");
11            var productUrl =  $(this).data("productUrl");
12            ACC.gtm.productClick_gtm(productCode, productName, productPrice, productManufacturerData, productUrl);
13        });
14
15        $(".productDetails .btn.btn-primary.btn-block.glyphicon.glyphicon-shopping-cart.js-enable-btn").on("click", function ()
16        {
17            var productCode =  $(this).data("productCode");
18            var productName =  $(this).data("productName");
19            var productPrice =  $(this).data("productPrice");
20            var initialQuantity =  $("input#pdpAddtoCartInput").val();
21
22            var packagingUnit = $(".product-details #packaging_unit");
23            // For Packs / Cases / Boxes
24            if(packagingUnit.length) {
25                initialQuantity =  $("input#pdpAddtoCartInput").val() * packagingUnit.find(":selected").val();
26            }
27
28            var productManufacturerData =  $(this).data("productManufacturerData");
29
30            ACC.gtm.addToCart_gtm(productCode, productName, productPrice, productManufacturerData, initialQuantity);
31        });
32
33        $(".product__listing.product__grid .btn.btn-primary.btn-block.glyphicon.glyphicon-shopping-cart.js-enable-btn").on("click", function ()
34        {
35            var productCode =  $(this).data("productCode");
36            var productName =  $(this).data("productName");
37            var productPrice =  $(this).parents('.details').find("div.priceAvailabilityAndLoader .price span").text().replace('$','');
38            var initialQuantity =  $(this).parent('form.add_to_cart_form').find("input[name=qty]").val();
39
40            var productManufacturerData =  $(this).data("productManufacturerData");
41
42            ACC.gtm.addToCart_gtm(productCode, productName, productPrice, productManufacturerData, initialQuantity);
43        });
44        $(".btn.btn-primary.btn-block.js-add-to-cart.js-enable-btn.btn-icon.glyphicon-shopping-cart").on("click", function ()
45        {
46            var productCode =  $(this).data("productCode");
47            var productName =  $(this).data("productName");
48            var productPrice =  $(this).data("productPrice");
49            var productManufacturerData =  $(this).data("productManufacturerData");
50            var initialQuantity = $('.qty').attr('value');
51            ACC.gtm.addToCart_gtm(productCode, productName, productPrice, productManufacturerData, initialQuantity);
52        });
53        $(".simple-banner.banner__component--responsive").on("click", function ()
54        {
55            var bannerId =  $(this).data("bannerId");
56            var bannerName =  $(this).data("bannerName");
57            var bannerCreative =  $(this).data("bannerCreative");
58            var bannerPos =  $(this).data("bannerPos");
59            var bannerUrl =  $(this).data("bannerUrl");
60            ACC.gtm.onBannerClick_gtm(bannerId, bannerName, bannerCreative, bannerPos, bannerUrl);
61        });
62        $(".btn.btn-primary.btn-block.btn--continue-checkout.js-continue-checkout-button, .btn.btn-primary.btn-block.checkout-next, .btn.btn-primary.btn-place-order.btn-block").on("click", function ()
63        {
64            var checkoutStep =  $(this).data("checkoutStep");
65            var option = "";
66
67            switch (checkoutStep) {
68                case 1: // CART CHECKOUT
69                    option = ''; // No selector in BSE : $("#selectAltCheckoutFlow option:selected").val();
70                    break;
71                case 2: // SHIPPING ADDRESS
72                    option = $('input[name="shippingAddressFormAddr"]:checked').val();
73                    break;
74                case 3: // DELIVERY METHOD (Pickup / Commun Carrier / UPS )
75                   option = $('input[name="delivery_method"]:checked').val();
76                   break;
77                case 4: // PAYMENT TYPE (CARD / ACCOUNT)
78                    option = $('input[name="paymentType"]:checked').val();
79                    break;
80                /*case 5: // PAYMENT METHOD paymentMethod
81                    option = option = $("#card_cardType option:selected").text();
82                    break;*/
83                case 5: // FINAL REVIEW confirmOrder
84                    option = $.trim($(".bse-totals .grand-total span").text());
85                    break;
86            }
87            ACC.gtm.checkout_gtm(checkoutStep, option);
88        });
89    },
90    addToCart_gtm: function(productCode, productName, productPrice, productManufacturerData, quantityAdded)
91    {
92        window.mediator.publish('addToCart_gtm',{
93            productCode: productCode,
94            productName: productName,
95            productPrice: productPrice,
96            productManufacturerData: productManufacturerData,
97            quantityAdded: quantityAdded
98        });
99    },
100    updateCart_gtm: function(productCode, productName, productPrice, productManufacturerData, initialQuantity, newQuantity)
101    {
102        initialQuantity = Number(initialQuantity);
103        newQuantity = Number(newQuantity);
104        if (initialQuantity != newQuantity) {
105            if (initialQuantity > newQuantity) {
106                ACC.gtm.removeFromCart_gtm(productCode, productName, productPrice, productManufacturerData, initialQuantity - newQuantity);
107            } else {
108                ACC.gtm.addToCart_gtm(productCode, productName, productPrice, productManufacturerData, newQuantity - initialQuantity);
109            }
110        }
111    },
112    removeFromCart_gtm: function(productCode, productName, productPrice, productManufacturerData, quantityRemoved)
113    {
114        window.mediator.publish('removeFromCart_gtm',{
115            productCode: productCode,
116            productName: productName,
117            productPrice: productPrice,
118            productManufacturerData: productManufacturerData,
119            quantityRemoved: quantityRemoved
120        });
121    },
122    productClick_gtm: function(productCode, productName, productPrice, productManufacturerData, productUrl)
123    {
124        window.mediator.publish('productClick_gtm',{
125            productCode: productCode,
126            productName: productName,
127            productPrice: productPrice,
128            productManufacturerData: productManufacturerData,
129            productUrl: productUrl
130        });
131    },
132    checkout_gtm: function(checkoutStep, option)
133    {
134        window.mediator.publish('checkout_gtm',{
135            checkoutStep: checkoutStep,
136            option: option
137        });
138    },
139    addToWishList_gtm: function(productCode, productName, productPrice, productManufacturer, quantity)
140    {
141        window.mediator.publish('addToWishList_gtm',{
142            productCode: productCode,
143            productName: productName,
144            productPrice: productPrice,
145            productManufacturer: productManufacturer,
146            quantity: quantity
147        });
148    }
149};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.