JIN33

Sekarang situs jin33 sudah rilis apk terbaru diplaystore. buruan unduh apk nya dari klik link resmi ini.

123,123 Member Baru Sudah Daftar Disini!

Price:Rp 33,333

Loading
Pilihan Tepat Main Slot Online Mudah JP

JIN33 : Link Playstore Rilis Apk Terbaru | Unduh Apk Klik Ini!

COBA MAIN

Loading...

Add to collection:

    FAQ SEPUTAR JIN33

    Apa yang dimaksud dengan JIN33?

    Sekarang situs jin33 sudah rilis apk terbaru diplaystore. buruan unduh apk nya dari klik link resmi ini.

    Apa keunggulan situs pusat JIN33?

    Memiliki beragam keunggulan terbaik seperti persentase live rtp slot tertinggi yang disediakan secara langsung oleh situs JIN33 pusat game online pilihan tepat.

    Game apa saja yang tersedia?

    Sebagai website resmi, dalam link alternatif JIN33 login menampilkan bermacam jenis game slot online terbaru dengan keuntungan mudah meraih jp ketika dimainkan.

    Apakah slot JIN33 pilihan tepat?

    Tentu saja tepat, link pusat JIN33 slot gacor hari ini menjadi salah satu rekomendasi google agar rakyat biasa dapat bermain secara kondusif meraih kemenangan besar.

    Kenapa harus main game JIN33?

    Karena hanya dengan main JIN33 game pilihan terbaik sangat mudah mendapatkan jp jackpot bahkan mudah maxwin apabila bermain sesuai syarat dan ketentuan yang berlaku.

    Bagaimana cara daftar login game?

    Langkah awal untuk melakukan pendaftaran, kunjungi terlebih dahulu link JIN33 alternatif login yang menjadi pusat daftar pilihan tepat bermain game slot terbaik.

    TESTIMONI PUSAT MAIN GAME JIN33

    JIN33 menjadi pusat main game slot online terbaik dengan beragam pilihan permainan tepat mudah meraih jp. Hendra (Surabaya)
    Main slot terbaik pakai link JIN33 alternatif agar dapat merasakan sensasi menang besar luar biasa maxwin. Gunawan (Aceh)
    Pilihan yang sangat tepat jika bermain pada situs main JIN33 login andalan para slotter meraih kemenangan. Tumini (Pekanbaru)
    Raih jp maximal secara tepat langsung hanya dalam situs JIN33 slot online gacor gampang menang anti kalah. Monalisa (Bali)
    Link pusat main game JIN33 resmi menjadi yang terbaik karena menyediakan bocoran rtp live winrate tertinggi. Karina (Balikpapan)
    Pusat game online pilihan rakyat dengan bermacam daftar permainan terbaru kini jatuh kepada situs slot JIN33. Sutomo (Jakarta)
    JIN33 Main Game Slot Online Terbaik
    _slider .product-card a', function() { const target = this; const eventUrl = anchorHref(target); const parent = target.closest('.product-card, .product-item'); const title = parent?.querySelector('.card-head'); const eventText = title ? elementText(title) : ''; const sliderParent = target.closest('.collection_slider, .conversion-module'); const sliderParentTitle = elementText(sliderParent?.querySelector('.collection_main_heading, .conversion-module__heading')) || ''; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'product_list_section_click', 'card_name': eventText, 'site_section': 'Collection Slider', 'slider_name': sliderParentTitle, 'click_url': stripDomain(eventUrl), }); //Global Click Migration window.APLdigitalData.push({ 'event': 'click', 'event_category': 'marketing', 'event_location': 'Collection Slider: '+ sliderParentTitle, 'event_action': 'product_list_section_click', 'event_label': eventText, 'click_url': stripDomain(eventUrl) }); }); // product card slider arrow $(document).on('click', '.collection_slider .slick-arrow, .conversion-module .slick-arrow', function() { const target = this; let direction; if (target.classList.contains('next')) { direction = 'Right' } else { direction = 'Left' } const parent = target.closest('.collection_slider, .conversion-module'); const parentTitle = elementText(parent?.querySelector('.collection_main_heading, .conversion-module__heading')) || ''; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'slider_arrow_click', 'slider_name': parentTitle, 'slider_direction': direction, }); //Global Click Migration window.APLdigitalData.push({ 'event': 'click', 'event_category': 'engagements', 'event_location': 'Collection Slider: '+ parentTitle, 'event_action': 'slider_arrow_click', 'event_label': 'Direction: '+ direction }); }); // global family stripe slider arrow $(document).on( 'click', '.nav-right-arrow.apl-section-carousel-arrows-next.slick-arrow, .nav-left-arrow.apl-section-carousel-arrows-previous.slick-arrow, #shopify-section-navigation_stripe .slick-arrow', function() { const target = this; let direction; if (target.classList.contains('nav-right-arrow') || target.classList.contains('apl-section-carousel-arrows-next')) { direction = 'Right'; } else { direction = 'Left'; } window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'family_stripe_arrow_click', 'slider_name': 'Family Stripe Navigation', 'slider_direction': direction, }); //Global Click Migration window.APLdigitalData.push({ 'event': 'click', 'event_category': 'engagements', 'event_location': 'Family Stripe Slider', 'event_action': 'family_stripe_arrow_click', 'event_label': 'Direction: ' + direction }); }); // product card slider pagination dot $(document).on('click', '.collection_slider .slick-dots li', function() { const target = this; const parent = target.closest('.collection_slider, .conversion-module'); const parentTitle = elementText(parent?.querySelector('.collection_main_heading, .conversion-module__heading')) || ''; //const sliderPosition = parseInt(elementText(target)) - 1; const sliderPosition = $(target).index() + 1; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'product_list_section_pagination_click', 'slider_name': parentTitle, 'slider_position': sliderPosition, }); //Global Click Migration window.APLdigitalData.push({ 'event': 'click', 'event_category': 'engagements', 'event_location': 'Product Card Slider: '+ parentTitle, 'event_action': 'product_list_section_pagination_click', 'event_label': 'Pagination: '+ sliderPosition }); }); // homepage slider banner image $(document).on('click', 'slideshow-component .full-link', function() { const target = this; const eventUrl = anchorHref(target); const $slide = $(target).closest('.slider__slide'); // Extract the aria-label value (e.g., "3 of 5") const ariaLabel = $slide.attr('aria-label') || ''; const sliderPosition = ariaLabel.split(' ')[0]; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'banner_click', 'site_section': 'Banner Section', 'slider_name': 'Hero Banner Slider', 'slider_position': sliderPosition || 'unknown', 'click_url': stripDomain(eventUrl), }); //Global Click Migration window.APLdigitalData.push({ 'event': 'click', 'event_category': 'marketing', 'event_location': 'Hero Slider', 'event_action': 'hero_banner_image_click', 'event_label': 'Pagination: '+ sliderPosition, 'click_url': stripDomain(eventUrl) }); }); // homepage slider banner click $(document).on('click', 'slideshow-component .slider-counter__link--dots', function() { const target = this; let sliderPosition = ''; // Get the aria-label attribute const ariaLabel = target.getAttribute('aria-label'); if (ariaLabel) { // Match "Load slide X of Y" const match = ariaLabel.match(/Load slide (\d+) of \d+/i); if (match && match[1]) { sliderPosition = match[1]; } } window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'banner_slider_click', 'site_section': 'Banner Section', 'slider_position': sliderPosition }); //Global Click Migration window.APLdigitalData.push({ 'event': 'click', 'event_category': 'engagements', 'event_location': 'Hero Slider', 'event_action': 'hero_banner_dot_click', 'event_label': 'Pagination: '+ sliderPosition }); }); // ctas const ctaSelectors = [ '.collage-button a', '.button_primary_anchor.card-btn', '.btn_prime_1.plp_page_ga a', '.image-with-text .img_with_txt_btn', '.multi_prop_tile_outer_new a', '.image_with_text_text_btns .button_primary a' ] $(document).on('click', ctaSelectors.join(','), function() { const target = this; const eventText = anchorText(target); const eventUrl = anchorHref(target); const eventLocation = window.getClickSection ? window.getClickSection(target) : ''; // ---- Parent / Slider Title logic ---- // let parentTitle = ''; let sliderParentTitle = ''; // let sliderPosition = null; const {parentTitle, sliderPosition } = getEventContext(eventLocation, target); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'cta_click', 'click_text': eventText, 'click_url': stripDomain(eventUrl) }); //Global Click Migration window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_location: eventLocation + ': '+ parentTitle, event_action: 'cta_click', event_label: eventText, click_url: stripDomain(eventUrl) }); }); const ctaButtonSelectors = [ '.img_with_txt_outer [onclick*="location.href="]', '.image-with-text [onclick*="location.href="]', ] $(document).on('click', ctaButtonSelectors.join(','), function() { const target = this; const eventText = elementText(target); const onclickAttr = target.getAttribute('onclick'); const regex = /location\.href\s*=\s*['"]([^'"]+)['"]/; const match = onclickAttr.match(regex); const eventUrl = match ? match[1] : ''; const eventLocation = window.getClickSection ? window.getClickSection(target) : ''; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'cta_click', 'click_text': eventText, 'click_url': stripDomain(eventUrl), }); //Global Click Migration window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_location: eventLocation, event_action: 'cta_click', event_label: eventText, click_url: stripDomain(eventUrl) }); }); // card clicks on images // only for search page if (window.location.pathname.includes('/search')) { $(document).on('click', '.you_may_also_like img', function() { const target = $(this).closest('a.full-unstyled-link'); const relativeUrl = target.attr('href') || ''; const eventUrl = window.location.origin + relativeUrl; const eventText = $(this).attr('alt') || ''; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'click', 'event_location': 'product_card_image', 'event_action': stripDomain(eventUrl), 'event_label': eventText, 'event_category': 'engagements' }); }); // card clicks on text $(document).on('click', '.card__information .full-unstyled-link-1', function() { const eventUrl = this.href || ''; const eventText = $(this).text().trim(); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'click', 'event_location': 'product_card_title', 'event_action': stripDomain(eventUrl), 'event_label': eventText, 'event_category': 'engagements' }); }); } //////////////////// PDP 2.0 Start ////////////////////////////////// if (window.location.pathname.includes('/products')) { // PDP 2.0 Image Carousel Arrow Click Previous document.addEventListener('click', function(e) { if (e.target.closest('.cto-gallery__arrow.prev-arrow.js-prev-button')) { window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'click', 'event_location': 'pdp_image_carousel', 'event_action': 'Previous', 'event_label': 'Arrow', 'event_category': 'engagements' }); } }); // PDP 2.0 Image Carousel Arrow Click Next document.addEventListener('click', function(e) { if (e.target.closest('.cto-gallery__arrow.next-arrow.js-next-button')) { window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'click', 'event_location': 'pdp_image_carousel', 'event_action': 'Next', 'event_label': 'Arrow', 'event_category': 'engagements' }); } }); // PDP 2.0 Image Carousel Dot Click document.addEventListener('click', function(e) { const dotButton = e.target.closest('.js-cto-gallery-dots .slick-dots li button'); if (dotButton) { // Get DOT Number from Button text const dotIndex = dotButton.textContent.trim(); // Send to dataLayer and console window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'click', 'event_location': 'pdp_image_carousel', 'event_action': 'Position: ' + dotIndex, 'event_label': 'Dot', 'event_category': 'engagements' }); } }); // PDP 2.0 Image Carousel Slider Click document.addEventListener('click', function(e) { const img = e.target.closest('img'); if (!img) return; const gallery = img.closest('.cto-gallery, .js-cto-gallery, .cto-gallery__slick, .js-cto-gallery-thumbs'); if (!gallery) return; const imageAlt = img.getAttribute('alt') || ''; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'click', 'event_location': 'pdp_image_carousel', 'event_action': 'Image Slider', 'event_label': imageAlt, 'event_category': 'engagements' }); }); // PDP 2.0 Financing options or pay in full document.addEventListener('click', function(e) { const label = e.target.closest('label'); if (!label) return; const fieldset = label.closest('.cto-financing__actions'); if (!fieldset) return; const radios = Array.from(fieldset.querySelectorAll('input[type="radio"]')); const input = document.getElementById(label.getAttribute('for')); if (!input) return; if (input.dataset.tracked) return; input.dataset.tracked = 'true'; const index = radios.indexOf(input); const eventLabel = index === 0 ? 'Financing' : 'Pay in Full'; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'click', 'event_location': 'pdp_financing_options', 'event_action': 'Select Financing Option', 'event_label': eventLabel, 'event_category': 'engagements' }); }); // PDP 2.0 Trade-In options document.addEventListener('click', function(e) { const label = e.target.closest('label'); if (!label) return; // const fieldset = label.closest('.product-form__input--trade-in'); if (!fieldset) return; const radios = Array.from(fieldset.querySelectorAll('input[type="radio"]')); const input = document.getElementById(label.getAttribute('for')); if (!input) return; if (input.dataset.tracked) return; input.dataset.tracked = 'true'; const index = radios.indexOf(input); const eventLabel = index === 0 ? 'Start Trade-in' : 'No Trade-in'; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'click', 'event_location': 'pdp_trade_in_options', 'event_action': 'Select Trade-in Option', 'event_label': eventLabel, 'event_category': 'engagements' }); }); // PDP 2.0 Continue Shopping click after Add to Cart on PDP document.addEventListener('click', function(e) { const continueBtn = e.target.closest( '.drawer__header--cto .continue_link--cto' ); if (continueBtn) { window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'click', 'event_location': 'pdp_cart_preview', 'event_action': 'Return to Main Page', 'event_label': 'Continue Shopping', 'event_category': 'engagements' }); } }); // --- PDP 2.0 Add to Cart Offer --- document.addEventListener('click', function(event) { // Find the clicked GWP item const gwpClickedItem = event.target.closest('.cto-gwp-item'); if (!gwpClickedItem) return; const gwpTitleEl = gwpClickedItem.querySelector('.cto-gwp-item__title'); const gwpPriceEl = gwpClickedItem.querySelector('.cto-gwp-item__price'); const gwpRemoveBtn = gwpClickedItem.querySelector('cart-remove-button a'); const gwpAddBtn = gwpClickedItem.querySelector('button.add-cart-apple-care, a.add-cart-apple-care'); const gwpLearnMoreBtn = gwpClickedItem.querySelector('a.ac-modal-trigger'); const gwpProductName = gwpTitleEl?.textContent.trim() || 'Unknown product'; const gwpPriceText = gwpPriceEl?.textContent.replace(/[^\d.]/g, '') || '0'; const gwpProductPrice = parseFloat(gwpPriceText); // Use current page URL after /products/ as parent handle const gwpParentHandle = window.location.pathname.split('/products/')[1] || 'Unknown'; window.APLdigitalData = window.APLdigitalData || []; // --- Prevent multiple pushes per element for a short time --- if (event.target.dataset.clicked) return; event.target.dataset.clicked = 'true'; setTimeout(() => event.target.dataset.clicked = '', 500); // --- Remove button click --- if (gwpRemoveBtn && event.target.closest('cart-remove-button a')) { window.APLdigitalData.push({ event: 'click', event_location: 'pdp_cart_preview', event_action: `Special Offer > Remove > ${gwpProductName}`, event_label: `Parent: ${gwpParentHandle}`, event_category: 'engagements' }); return; } // --- Add button click --- if (gwpAddBtn && event.target.closest('button.add-cart-apple-care, a.add-cart-apple-care')) { window.APLdigitalData.push({ event: 'click', event_location: 'pdp_cart_preview', event_action: `Special Offer > Add > ${gwpProductName}`, event_label: `Parent: ${gwpParentHandle}`, event_category: 'engagements' }); return; } // --- Learn More button click --- if (gwpLearnMoreBtn && event.target.closest('a.ac-modal-trigger')) { window.APLdigitalData.push({ event: 'click', event_location: 'pdp_cart_preview', event_action: `Special Offer > Learn More > ${gwpProductName}`, event_label: `Parent: ${gwpParentHandle}`, event_category: 'engagements' }); return; } // --- Title click --- if (gwpTitleEl && event.target.closest('.cto-gwp-item__title')) { window.APLdigitalData.push({ event: 'click', event_location: 'pdp_cart_preview', event_action: `Special Offer > Title click > ${gwpProductName}`, event_label: `Parent: ${gwpParentHandle}`, event_category: 'engagements' }); return; } }); // --- PDP 2.0 New Bundles --- // document.addEventListener('change', function (e) { const input = e.target.closest('.js-cto-bundle-option'); if (!input || input.type !== 'radio' || !input.checked) return; // Find the closest bundle option container const bundleOption = input.closest('.cto-bundle__option'); // Get bundle name from data attribute, label text, or input value as fallback let bundleName = input.dataset.bundleName || (bundleOption?.querySelector('.cto-bundle__label-title')?.textContent.trim()) || input.value || 'Unknown bundle'; // Get strictly H1 text content const eventLabel = document.querySelector('h1')?.textContent.trim() || 'Unknown product'; // Collect all product-related data const product = { bundleVariantId: input.dataset.bundleVariantId, bundleSku: input.dataset.bundleSku, priceRawSetAs: input.dataset.priceRawSetAs, compareAtPriceRawSetAs: input.dataset.compareAtPriceRawSetAs, productId: input.dataset.productId, pairedProductId: input.dataset.pairedProductId, handle: input.dataset.handle, qtyLimit: input.dataset.qtyLimit, vatPriceRawSetAs: input.dataset.vatPriceRawSetAs, gtmFormInteractFieldId: input.dataset.gtmFormInteractFieldId, bundleName: bundleName, bundleValue: input.value }; // Push the event to dataLayer window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'click', event_location: 'pdp_bundle_option', event_action: 'Bundle > Option Select > ' + product.bundleValue, event_label: eventLabel, event_category: 'engagements', product }); console.log('Bundle event fired:', { event: 'click', event_label: eventLabel, product }); }); // -------------------------------------- // PDP Bundle — Learn More Click Tracking // -------------------------------------- $(document).on( 'click', '#bundleForm a.ac-modal-trigger[data-modal-target^="modal-bundle-modal"]', function () { const target = this; const wrapper = target.closest('.cto-bundle__option'); const selectedOption = wrapper?.querySelector('.js-cto-bundle-option'); if (!selectedOption) { console.warn('Learn More clicked but no bundle option element found'); return; } const h1 = document.querySelector('h1'); const pdpTitle = h1?.innerText?.trim() || undefined; const clickProductName = wrapper?.querySelector('.cto-bundle__label-title')?.innerText?.trim() || ''; const eventData = { event: 'click', event_location: 'pdp_bundle_option', event_action: `Bundle > Learn More > ${clickProductName}`, event_label: pdpTitle, event_category: 'engagements', product: { bundleVariantId: selectedOption.dataset.bundleVariantId, bundleSku: selectedOption.dataset.bundleSku, priceRawSetAs: selectedOption.dataset.priceRawSetAs, compareAtPriceRawSetAs: selectedOption.dataset.compareAtPriceRawSetAs, productId: selectedOption.dataset.productId, pairedProductId: selectedOption.dataset.pairedProductId, handle: selectedOption.dataset.handle, qtyLimit: selectedOption.dataset.qtyLimit, vatPriceRawSetAs: selectedOption.dataset.vatPriceRawSetAs, gtmFormInteractFieldId: selectedOption.closest('#bundleForm')?.dataset.gtmFormInteractId, bundleName: selectedOption.dataset.bundleName, bundleValue: selectedOption.dataset.bundleName } }; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push(eventData); } ); // Before brackets, if will be only on PDP }// After brackets, if will be not only on PDP // Pick-Up Location CLick // ============================== // ========================= // listener // ========================= $(document).on( 'click', '.js-my-store-locator-drawer-btn, .js-my-store-locator-btn, .my-store-locator__details-btn--secondary', function () { const target = this; const locationName = target.querySelector('.underlined-text')?.innerText?.trim() || target.querySelector('.my-store-locator__info')?.innerText?.trim() || target.innerText?.trim() || ''; const sectionName = getClickSection(target); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'click', event_category: 'engagements', event_location: sectionName, event_action: 'pickup_availability', event_label: locationName, event_flow: `${sectionName} > ${locationName}` }); } ); /// Notify Me BTN /collections/ click ///// document.addEventListener('click', function (e) { const btn = e.target.closest( '.apl-section-image-with-text-cta-shop .notify__button-text, ' + '.apl-section-image-with-text-cta-shop .notify__button-text--mobile' ); if (!btn) return; const link = btn.closest('a'); if (!link) return; const block = link.closest('.image-with-text__content'); const eventLocation = block ?.querySelector('.apl-section-image-with-text-title') ?.innerText .trim(); const clickText = btn.innerText.trim(); const clickUrl = link.getAttribute('href'); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_action: 'Notify Me Button Click', event_location: eventLocation || 'unknown', event_label: clickText, click_url: stripDomain(clickUrl) }); }); /// Notify Me BTN Sticky Footer click ///// document.addEventListener('click', function (e) { const btn = e.target.closest( '.sticky-atc-bar .js-notify-modal-open_button.notify__button' ); if (!btn) return; const clickText = btn .querySelector('.notify__button-text') ?.innerText .trim(); const eventLocation = window.getClickSection ? window.getClickSection(e.target) : ''; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_action: 'Notify Me Click', event_location: eventLocation || 'unknown', event_label: clickText || 'Notify me when it\'s available', click_url: '' }); }); /// Notify Me Modal Submit ///// document.addEventListener('click', function (e) { const btn = e.target.closest('#notifyModal .js-notify-submit'); if (!btn) return; const textEl = btn.querySelector('.modal__submit-text'); const clickText = textEl ? textEl.innerText.trim() : ''; const eventLocation = window.getClickSection ? window.getClickSection(e.target) : ''; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_action: 'Notify Me Submit', event_location: eventLocation || 'unknown', event_label: clickText, click_url: '' }); }); // ======================== // Notify Me Modal — Input click (USER ONLY, ONCE PER OPEN) // ======================== (function () { let inputTracked = false; document.addEventListener('click', function (e) { const input = e.target.closest('#notifyModal .js-notify-input'); const eventLocation = window.getClickSection ? window.getClickSection(e.target) : ''; if (!input) return; if (inputTracked) return; inputTracked = true; const clickText = input.getAttribute('aria-label') || 'Notify Me Input'; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_action: 'Notify Me Input Click', event_location: eventLocation, event_label: clickText, click_url: '' }); }); // ======================== // Reset on modal close // ======================== document.addEventListener('click', function (e) { const closeBtn = e.target.closest( '#notifyModal .js-notify-success-button, #notifyModal .modal__close, #notifyModalClose' ); if (!closeBtn) return; inputTracked = false; }); })(); /// Notify Me Modal Close ///// document.addEventListener('click', function (e) { const btn = e.target.closest('#notifyModal .modal-close-button'); const eventLocation = window.getClickSection ? window.getClickSection(e.target) : ''; if (!btn) return; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_action: 'Notify Me Modal Close', event_location: eventLocation || 'unknown', event_label: btn.innerText.trim(), click_url: '' }); }); // Hamburger Menu Update (Open / Close) function trackHamburgerClick(summaryEl) { if (!summaryEl) return; const isOpening = summaryEl.getAttribute('aria-expanded') === 'false'; APLdigitalData.push({ event: "click", event_category: "navigation", event_location: "Header", event_action: isOpening ? "hamburger_menu_close" : "hamburger_menu_open", event_label: "Hamburger Menu", click_url: window.location.pathname }); } document.addEventListener('click', function (e) { const summary = e.target.closest('summary.header__icon--menu'); if (summary) { if (!summary.dataset.hamburgerTracked) { summary.dataset.hamburgerTracked = 'true'; trackHamburgerClick(summary); setTimeout(() => { summary.dataset.hamburgerTracked = ''; }, 10); } } }); //////////////////// PDP 2.0 END ////////////////////////////////// // marketing pages // $(document).on('click', '.ac-modal-trigger[data-ajax-url*="?view=river_content"]', function() { $(document).on('click', '.ac-modal-trigger[data-ajax-url]', function(e) { const target = e.currentTarget; if (!target.dataset.ajaxUrl || target.dataset.ajaxUrl.trim() === '') return; const eventLocation = window.getClickSection ? window.getClickSection(target) : ''; const eventText = elementText(target); //const pageUrl = target.dataset.ajaxUrl?.split('?view')?.[0]?.replace('/pages/', '') || ''; const pageUrl = target.dataset.originalAjaxUrl?.split('?view')?.[0]?.replace('/pages/', '') || target.dataset.ajaxUrl?.split('?view')?.[0]?.replace('/pages/', '') || ''; const {parentTitle, sliderPosition } = getEventContext(eventLocation, target); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'marketing_page_click', marketing_page_name: pageUrl, click_text: eventText }); // Global Click Migration window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_location: eventLocation + (parentTitle ? ': ' + parentTitle : ''), event_action: 'marketing_page_click', event_label: eventText, click_url: pageUrl }); }); // Marketing Page CTA Clicks // --- Universal Marketing Page CTA Clicks --- // --- Clicks inside normal modals and page --- $(document).on('click', '.ac-modal a[href]', function() { const target = this; // --- Inline helper: strip domain --- function stripDomain(url) { try { if (url.startsWith('/') || url.startsWith('//')) return url; const u = new URL(url, window.location.origin); return u.pathname + u.search + u.hash; } catch (e) { return url; } } const eventText = anchorText(target); const eventUrl = anchorHref(target); // --- Universal parent lookup --- const parent = target.closest('.ac-modal'); const modalTrigger = document.querySelector(`.ac-modal-trigger[data-modal-target="${parent?.id}"]`); // --- Page URL fallback --- const pageUrlRaw = modalTrigger?.dataset.originalAjaxUrl || modalTrigger?.dataset.ajaxUrl || window.location.pathname; const pageUrl = pageUrlRaw.split('?view')?.[0]?.replace('/pages/', '') || ''; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'marketing_page_cta_click', marketing_page_name: pageUrl, click_text: eventText, click_url: stripDomain(eventUrl), }); // Global Click Migration window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_location: 'Marketing Page: ' + pageUrl, event_action: 'marketing_page_cta_click', event_label: eventText, click_url: stripDomain(eventUrl), }); }); // --- Clicks inside iframe modals --- window.adobeTrackMarketingPageIframeCtaClick = function(iframe) { const iframeDoc = iframe.contentWindow.document; iframeDoc.querySelectorAll('a[href]').forEach(anchor => { anchor.addEventListener('click', function() { const target = this; // --- Inline helper: strip domain --- function stripDomain(url) { try { if (url.startsWith('/') || url.startsWith('//')) return url; const u = new URL(url, window.location.origin); return u.pathname + u.search + u.hash; } catch (e) { return url; } } const eventText = anchorText(target); const eventUrl = anchorHref(target); const parent = iframe.closest('.ac-modal'); const modalTrigger = document.querySelector(`.ac-modal-trigger[data-modal-target="${parent?.id}"]`); const pageUrlRaw = modalTrigger?.dataset.originalAjaxUrl || modalTrigger?.dataset.ajaxUrl || window.location.pathname; const pageUrl = pageUrlRaw.split('?view')?.[0]?.replace('/pages/', '') || ''; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'marketing_page_cta_click', marketing_page_name: pageUrl, click_text: eventText, click_url: stripDomain(eventUrl), }); window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_location: 'Marketing Page: ' + pageUrl, event_action: 'marketing_page_cta_click', event_label: eventText, click_url: stripDomain(eventUrl), }); }); }); }; // marketing page scroll $(document).on('click', '.ac-modal-trigger[data-ajax-url*="?view=river_content"]:not([data-ajax-iframe="true"])', function() { const target = this; const pageUrl = target.dataset.ajaxUrl?.split('?view')?.[0]?.replace('/pages/', '') || ''; const modal = document.querySelector(`#${target.dataset.modalTarget}`); if (!modal) return; const modalParent = modal.closest('.modal'); if (modalParent?.classList?.contains('adobe-tracking-scroll')) return; modalParent.classList.add('adobe-tracking-scroll'); const debouncedScroll = debounce(function() { const scrollDepth = Math.round((modalParent.scrollTop / (modalParent.scrollHeight - modalParent.clientHeight)) * 100); const steps = [100, 75, 50, 25, 0]; const scrollThreshold = steps.find(step => scrollDepth >= step); window.APLdigitalDataClient = window.APLdigitalDataClient || []; if (scrollThreshold === 0||scrollThreshold === undefined||window.APLdigitalDataClient.find(data => data.event === 'marketing_page_scroll' && data.marketing_page_name === pageUrl && data.scroll_depth_threshold === `${scrollThreshold}%`) ) return; window.APLdigitalDataClient.push({ 'event': 'marketing_page_scroll', 'marketing_page_name': pageUrl, 'scroll_depth_threshold': `${scrollThreshold}%`, }); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'marketing_page_scroll', 'marketing_page_name': pageUrl, 'scroll_depth_threshold': `${scrollThreshold}%`, }); }, 50); $(modalParent).on('scroll', debouncedScroll); }); window.adobeTrackMarketingPageIframeScroll = function(iframe) { const iframeDoc = iframe.contentWindow.document; const modalParent = iframe.closest('.modal'); const parent = iframe.closest('.ac-modal'); const modalTrigger = document.querySelector(`.ac-modal-trigger[data-modal-target="${parent.id}"]`); const pageUrl = modalTrigger.dataset.ajaxUrl?.split('?view')?.[0]?.replace('/pages/', '') || ''; if (modalParent?.classList?.contains('adobe-tracking-scroll')) return; modalParent.classList.add('adobe-tracking-scroll'); const debouncedScroll = debounce(function() { const scrollElement = iframeDoc.documentElement; const scrollDepth = Math.round((scrollElement.scrollTop / (scrollElement.scrollHeight - scrollElement.clientHeight)) * 100); const steps = [100, 75, 50, 25, 0]; const scrollThreshold = steps.find(step => scrollDepth >= step); window.APLdigitalDataClient = window.APLdigitalDataClient || []; if (scrollThreshold === 0||window.APLdigitalDataClient.find(data => data.event === 'marketing_page_scroll' && data.marketing_page_name === pageUrl && data.scroll_depth_threshold === `${scrollThreshold}%`) ) return; window.APLdigitalDataClient.push({ 'event': 'marketing_page_scroll', 'marketing_page_name': pageUrl, 'scroll_depth_threshold': `${scrollThreshold}%`, }); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'marketing_page_scroll', 'marketing_page_name': pageUrl, 'scroll_depth_threshold': `${scrollThreshold}%`, }); }, 50); $(iframeDoc).on('scroll', debouncedScroll); } // non-marketing modal pages const modalTargets = [ '="modal-net-monthly-pricing-modal"', '="modal-pdp-apple-care-modal"', '="modal-trade-in-modal"', '*="modal-cart-apple-care-modal"', '*="modal-cart-warranty-modal"', '*="modal-trade-in-learn-more-modal"', '*="modal-trade-in-modal"', ] $(document).on( 'click', ` ${modalTargets.map(target => `.ac-modal-trigger[data-modal-target${target}]`).join(',')}, .js-trade-in-modal-trigger-secondary-cart `, function(e) { if (!e.originalEvent.isTrusted) { return; } const target = this; const eventText = elementText(target, true); const eventLocation = window.getClickSection ? window.getClickSection(target) : ''; const modalTarget = target.dataset.modalTarget || ''; const modalForTarget = document.querySelector(`.ac-modal[id=${target.dataset.modalTarget}]`); const modalTitleElem = modalForTarget?.querySelector('h1, h2, h3, h4, h5, h6, .apple-care-modal__heading'); const modalTitle = modalTitleElem ? elementText(modalTitleElem, true) : ''; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'modal_page_click', 'modal_page_name': modalTitle, 'click_text': eventText, }); // Global Click Migration window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_location: eventLocation + (modalTitle ? ': ' + modalTitle : ''), event_action: 'modal_page_click', event_label: eventText, click_url: modalTarget }); } ); // non-marketing modal cta clicks $(document).on('click', modalTargets.map(target => `.ac-modal[id${target}] a[href], .ac-modal[id${target}] button`).join(','), function() { const target = this; let eventText; let eventUrl; const modalElem = target.closest('.ac-modal'); const eventLocation = modalElem ? modalElem.id || '' : ''; const clickClass = target.classList.length ? target.classList[0] : ''; if (target.tagName === 'A') { eventText = anchorText(target); eventUrl = anchorHref(target); } else { eventText = elementText(target); eventUrl = clickClass; } const modalTitleElem = target.closest('.ac-modal').querySelector('h1, h2, h3, h4, h5, h6, .apple-care-modal__heading'); const modalTitle = modalTitleElem ? elementText(modalTitleElem, true) : ''; const parent = target.closest('.ac-modal'); const modalId = parent ? parent.id : ''; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'modal_page_cta_click', 'modal_page_name': modalTitle, 'event_location': eventLocation, 'event_action': clickClass, 'click_text': eventText, 'click_url': stripDomain(eventUrl), }); // Global Click Migration window.APLdigitalData.push({ event: 'click', event_category: 'marketing', event_location: 'Modal Page: ' + modalId, event_action: 'modal_page_cta_click', event_label: eventText, click_url: stripDomain(eventUrl), }); }); //scrolling threshold of all pages /* (function() { const thresholds = [100, 75, 50, 25]; const triggeredThresholds = new Set(); function debounce(func, wait) { let timeout; return function() { const context = this, args = arguments; clearTimeout(timeout); timeout = setTimeout(() => func.apply(context, args), wait); }; } const debouncedScroll = debounce(function() { const scrollTop = window.scrollY || window.pageYOffset; const docHeight = Math.max( document.documentElement.scrollHeight, document.body.scrollHeight, document.documentElement.offsetHeight, document.body.offsetHeight, document.documentElement.clientHeight ); const winHeight = window.innerHeight; const scrollPercent = Math.round(((scrollTop + winHeight) / docHeight) * 100); const scrollThreshold = thresholds.find(threshold => scrollPercent >= threshold); const pageTitle = document.title || ''; if ( !scrollThreshold || triggeredThresholds.has(scrollThreshold) ) return; triggeredThresholds.add(scrollThreshold); window.APLdigitalDataClient = window.APLdigitalDataClient || []; window.APLdigitalDataClient.push({ 'event': 'page_scroll', 'page_name': pageTitle, 'scroll_depth_threshold': `${scrollThreshold}%` }); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'page_scroll', 'page_name': pageTitle, 'scroll_depth_threshold': `${scrollThreshold}%` }); }, 200); window.addEventListener('scroll', debouncedScroll); })(); */ // accordion $(document).on('click', '.product__accordion summary', function() { const target = this; const eventLocation = window.getClickSection ? window.getClickSection(target) : ''; const eventText = elementText(target); const action = target.getAttribute('aria-expanded') === 'true' ? 'accordion_open' : 'accordion_close'; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': action, 'accordion_item': eventText, }); //Global Click Migration window.APLdigitalData.push({ 'event': 'click', 'event_category': 'engagements', 'event_location': eventLocation, 'event_action': action, 'event_label': eventText, 'click_url': '' }); }); // external link click $(document).on('click', 'a[href^="http"]', function() { const target = this; const eventLocation = window.getClickSection ? window.getClickSection(target) : ''; const eventText = anchorText(target); const eventUrl = anchorHref(target); const urlHostname = (new URL(eventUrl))?.hostname; if (urlHostname === window.location.hostname) { return; } window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'external_link_click', 'click_text': eventText, 'click_url': stripDomain(eventUrl), }); //Global Click Migration window.APLdigitalData.push({ 'event': 'click', 'event_category': 'engagements', 'event_location': eventLocation, 'event_action': 'external_link_click', 'event_label': eventText, 'click_url': urlHostname }); }); // cart "More payment options" cta $(document).on('click', '.expedited-checkout .checkout-button__link', function() { const target = this; const eventLocation = window.getClickSection ? window.getClickSection(target) : ''; const eventText = elementText(target); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'more_payment_options_click', 'click_text': eventText, }); //Global Click Migration window.APLdigitalData.push({ 'event': 'click', 'event_category': 'engagements', 'event_location': eventLocation, 'event_action': 'more_payment_options_click', 'event_label': eventText, 'click_url': '' }); }); // view pdp if (SDG.Data.template.startsWith('product')) { const prodView = async () => { const productData = await adobeProductData(); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'prodView', 'product': productData }); }; prodView(); } // pdp AppleCare $(document).on('click', 'label[for="add-apple-care"]', function(event) { // If the click target is the input itself, ignore if (event.target.tagName.toLowerCase() === 'input') return; const label = this; const inputId = label.getAttribute('for'); const input = document.getElementById(inputId); if (!input) return; // Delay so checkbox state updates setTimeout(async function() { if (!input.checked) return; const parent = label.closest('.add-on-product-style'); const container = label.closest('.container-box-2'); if (!container) return; if (container.id !== 'apple-care-add') return; const title = parent ? parent.querySelector('h3') : null; const appleCarePlan = elementText(title); const pageUrl = window.location.href; const pageTitle = document.title || ''; const productData = await adobeProductData(); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'applecare+_add', 'apple_care+_plan': appleCarePlan, 'product': productData?.product_name, }); console.log('Applecare+ selection tracked', { apple_care_plan: appleCarePlan }); }, 0); }); // pdp AppleCare no coverage selected $(document).on('click', 'label[for="remove-insurance"]', function(event) { // If the user actually clicked the input, do nothing if (event.target.tagName.toLowerCase() === 'input') return; const label = this; const inputId = label.getAttribute('for'); const input = document.getElementById(inputId); if (!input) return; // Use a delay so the input.checked state updates setTimeout(async function() { if (!input.checked) return; const clickText = elementText(label); const optionValue = input.value || ''; const pageUrl = window.location.href; const pageTitle = document.title || ''; const productData = await adobeProductData(); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'applecare+_no_coverage', 'product': productData?.product_name, }); console.log('Applecare+ selection tracked', { option_value: optionValue, click_text: clickText }); }, 0); }); // pdp AppleCare PDP 1.0 $(document).on('click', '.product #apple-care-add', async function() { const productData = await adobeProductData(); let appleCarePlan1 = 'AppleCare+ for ' + productData?.product_name; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'applecare+_add', 'apple_care+_plan': appleCarePlan1, 'product': productData?.product_name, }); console.log('Applecare+ selection tracked', { apple_care_plan: appleCarePlan1 }); }); // pdp Third-Party Warranty PDP 1.0 $(document).on('click', '.product #secWarranty-add', async function() { const productData = await adobeProductData(); let appleCarePlan1 = 'Third-Party Warranty for ' + productData?.product_name; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'applecare+_add', 'apple_care+_plan': appleCarePlan1, 'product': productData?.product_name, }); console.log('Applecare+ selection tracked', { apple_care_plan: appleCarePlan1 }); }); // cart AppleCare $(document).on('click', '.add-cart-apple-care[data-reference="aplcr"], .add-cart-apple-care[data-reference="secwr"]', function() { const target = this; const parent = target.closest('.cart_itemadd'); const title = parent.querySelector('.apple-care-card-title'); const appleCarePlan = elementText(title); const mainProductIndex = target.dataset.forproduct; const mainProductParent = document.getElementById(`CartItem-${mainProductIndex}`); const productData = JSON.parse(mainProductParent.querySelector('.adobe-analytics-cart-item-data').textContent).payload; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'applecare+_add', 'apple_care+_plan': appleCarePlan, 'product': productData?.product_name, 'currency': productData?.currency, 'product_price': productData?.product_price, 'brand': productData?.brand, }); }); // Trade-in button on PDP $(document).on('click', '.apl-section-trade-in-form-option-start-trade-in.js-trade-in-modal-trigger-input', function(event) { const label = this; const inputId = label.getAttribute('for'); const input = document.getElementById(inputId); if (!input) return; // Use a delay so the input.checked state updates setTimeout(async function() { if (!input.checked) return; const clickText = elementText(label); const optionValue = input.value || ''; const pageUrl = window.location.href; const pageTitle = document.title || ''; const productData = await adobeProductData(); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'button_click', 'click_text': clickText, 'product': productData?.product_name, }); console.log('Trade-in selection tracked', { option_value: optionValue, click_text: clickText }); }, 0); }); $(document).on('click', '.apl-section-trade-in-form-option-no-trade-in', function(event) { const label = this; const inputId = label.getAttribute('for'); const input = document.getElementById(inputId); if (!input) return; // Use a delay so the input.checked state updates setTimeout(async function() { if (!input.checked) return; const clickText = elementText(label); const optionValue = input.value || ''; const pageUrl = window.location.href; const pageTitle = document.title || ''; const productData = await adobeProductData(); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'button_click', 'click_text': clickText, 'product': productData?.product_name, }); console.log('Trade-in selection tracked', { option_value: optionValue, click_text: clickText }); }, 0); }); // Financing button on PDP $(document).on('click', '.apl-section-cto-financing-start', function (event) { const label = this; const inputId = label.getAttribute('for'); const input = document.getElementById(inputId); if (!input) return; // Use a delay so the input.checked state updates setTimeout(async function () { if (!input.checked) return; const clickText = elementText(label); const optionValue = input.value || ''; const pageUrl = window.location.href; const pageTitle = document.title || ''; const productData = await adobeProductData(); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'button_click', click_text: clickText, product: productData?.product_name, }); console.log('Financing selection tracked', { option_value: optionValue, click_text: clickText, }); }, 0); }); //Decline Financing $(document).on('click', '.cto-financing__input.js-cto-financing-input.apl-section-cto-financing-decline-financing', function(event) { const label = this; const inputId = label.getAttribute('for'); const input = document.getElementById(inputId); if (!input) return; // Use a delay so the input.checked state updates setTimeout(async function() { if (!input.checked) return; const clickText = elementText(label); const optionValue = input.value || ''; const pageUrl = window.location.href; const pageTitle = document.title || ''; const productData = await adobeProductData(); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'button_click', click_text: clickText, product: productData?.product_name, }); console.log('Decline Financing selection tracked', { option_value: optionValue, click_text: clickText, }); }, 0); }); // Store locator select store $(document).on('click', '.js-store-locator-select-btn', function() { const target = this; const parent = target.closest('my-store-locator-drawer'); const activeResult = parent.querySelector(parent.dom.activeResult); const storeName = elementText(activeResult.querySelector('.my-location-result__name')); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'pick-in_store_click', 'store_name': storeName, }); }); // pdp quantity selector $(document).on('click', '.product-form__quantity .js-qty-input .quantity__button', async function() { const target = this; const productData = await adobeProductData(); const event = target.name === 'plus' ? 'quantity_selector_plus' : 'quantity_selector_minus'; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': event, 'product_name': productData?.product_name, 'mpn_id': productData?.mpn_id, }); }); // cart quantity selector $(document).on('click', '.cart-item .quantity__button', function() { const target = this; const parent = target.closest('.cart-item'); const productData = JSON.parse(parent.querySelector('.adobe-analytics-cart-item-data').textContent).payload; const event = target.name === 'plus' ? 'quantity_selector_plus' : 'quantity_selector_minus'; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': event, 'product_name': productData?.product_name, 'mpn_id': productData?.mpn_id, }); }); // pdp frequently bought together product $(document).on('change', '.js-frequent-products-checkbox', function() { const target = this; const isSelected = target.checked; const event = isSelected ? 'frequently_bought_together_product_select' : 'frequently_bought_together_product_unselect'; const parent = target.closest('.frequent-product-list'); const productData = JSON.parse(parent.querySelector('.adobe-analytics-frequently-products-card-data').textContent); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': event, 'product_name': productData?.title, 'mpn_id': productData?.mpn, }); }); // VIDEO EVENTS /** * Returns the slide URL for a given video element. * Traverses up the DOM to find the closest .slideshow__slide, * then extracts the href from the .full-link anchor inside it. * * @param {HTMLVideoElement} videoElement * @returns {string|undefined} Absolute URL or undefined if not found */ function videoslideUrl(videoElement) { const slide = videoElement.closest('.slideshow__slide'); if (!slide) return undefined; const link = slide.querySelector('a.full-link'); if (!link) return undefined; const href = link.getAttribute('href'); if (!href) return undefined; // Convert relative path to absolute URL using current origin return new URL(href, window.location.origin).href; } /** * Returns the name/identifier of a given video element. * Used as a unique video_id in all tracking events. * * @param {HTMLVideoElement} target * @returns {string} */ function videoSliderName(target) { // Grab the src of the first tag, or fall back to the video's own src const source = target.querySelector('source'); return source ? source.src : target.src; } // ───────────────────────────────────────────── // VIDEO PLAY // Fires once per video when playback starts. // Skips if the same video_play event was already pushed. // ───────────────────────────────────────────── $('video').on('play', function () { const target = this; const vidName = videoSliderName(target); const fullURL = videoslideUrl(target); const url = stripDomain(fullURL); window.APLdigitalDataClient = window.APLdigitalDataClient || []; // Deduplicate: fire only once per video if (window.APLdigitalDataClient.find( data => data.event === 'video_play' && data.video_id === vidName )) return; // Build payload; slide_url is included only if the video lives inside a slide const payload = { event: 'video_play', video_id: vidName, ...(url && { click_url: url }) }; window.APLdigitalDataClient.push(payload); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push(payload); }); // ───────────────────────────────────────────── // VIDEO PAUSE // Fires once per video when playback is paused. // Ignores the final "pause" that fires right before the ended event. // ───────────────────────────────────────────── $('video').on('pause', function () { const target = this; const vidName = videoSliderName(target); const fullURL = videoslideUrl(target); const url = stripDomain(fullURL); // Do not track pause if the video has already ended (ended triggers pause too) if (target.ended) return; window.APLdigitalDataClient = window.APLdigitalDataClient || []; // Deduplicate: fire only once per video if (window.APLdigitalDataClient.find( data => data.event === 'video_pause' && data.video_id === vidName )) return; const payload = { event: 'video_pause', video_id: vidName, ...(url && { click_url: url }) }; window.APLdigitalDataClient.push(payload); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push(payload); }); // ───────────────────────────────────────────── // VIDEO PROGRESS + COMPLETE // Fires on every timeupdate tick. // Tracks progress milestones: 25%, 50%, 75%. // Tracks completion separately as video_complete at 100%. // Each milestone fires only once per video. // ───────────────────────────────────────────── $('video').on('timeupdate', function () { const target = this; const vidName = videoSliderName(target); const fullURL = videoslideUrl(target); const url = stripDomain(fullURL); const duration = target.duration; const currentTime = target.currentTime; // Avoid division by zero or NaN before metadata is loaded if (!duration || isNaN(duration)) return; const progress = Math.round((currentTime / duration) * 100); // Milestones to track (descending order so we match the highest reached threshold) const steps = [100, 75, 50, 25, 0]; const progressThreshold = steps.find(step => progress >= step); window.APLdigitalDataClient = window.APLdigitalDataClient || []; // ── 100% → video_complete ────────────────── if (progressThreshold === 100) { // Deduplicate: fire only once per video if (window.APLdigitalDataClient.find( data => data.event === 'video_complete' && data.video_id === vidName )) return; const payload = { event: 'video_complete', video_id: vidName, ...(url && { click_url: url }) }; window.APLdigitalDataClient.push(payload); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push(payload); // ── 25% / 50% / 75% → video_progress ────── } else if (progressThreshold > 0) { // Deduplicate: fire only once per milestone per video if (window.APLdigitalDataClient.find( data => data.event === 'video_progress' && data.video_id === vidName && data.video_progress === `${progressThreshold}%` )) return; const payload = { event: 'video_progress', video_id: vidName, video_progress: `${progressThreshold}%`, ...(url && { click_url: url }) }; window.APLdigitalDataClient.push(payload); window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push(payload); } // 0% threshold is intentionally ignored — no event fired at 0% }); // VIDEO END // // account login $(document).on('submit', '#customer_login', function() { window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'login', 'login_form_location': 'login page', }); }); // account logout $(document).on('click', 'a[href*="/account/logout"]', function() { window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'logout', 'login_form_location': 'login page', }); }); // account register form start $(document).on('input', '#create_customer', function() { window.APLdigitalData = window.APLdigitalData || []; if (!window.APLdigitalData.some(data => data.event === 'signup_start')) { window.APLdigitalData.push({ 'event' : 'signup_start', }); } }); // account register form submit $(document).on('submit', '#create_customer', function() { window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event' : 'signup_success', }); }); // filters click $(document).on('click', '#FacetFiltersForm .facet-checkbox input', function() { const target = this; const eventLocation = window.getClickSection ? window.getClickSection(target) : ''; const parent = target.closest('.js-filter'); const parentItem = target.closest('.facets__item'); if (!parent) return ''; const category = parent.querySelector('.facets__summary'); const cloneCategory = category.cloneNode(true); cloneCategory.querySelector('.facets__selected')?.remove(); const categoryText = category ? elementText(cloneCategory) : ''; let labelText; if (parentItem.classList.contains('list-menu__item--pickup')) { const label = parentItem ? parentItem.querySelector('span') : null; const pickupText = label ? elementText(label) : ''; const location = parentItem ? parentItem.querySelector('.js-my-store-locator-search-drawer-launcher') : null; const locationText = location ? elementText(location) : ''; labelText = `${pickupText} ${locationText}`; } else { const label = parentItem ? parentItem.querySelector('span[aria-hidden]') : null; const cloneLabel = label?.cloneNode(true); cloneLabel?.querySelector('.filter-count')?.remove(); labelText = label ? elementText(cloneLabel) : ''; } const elCount = document.querySelector('#ProductCountDesktop'); if (!elCount) return; const countProducts = parseInt(elCount.textContent, 10); if (!countProducts) return; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'filter_click', 'filter_category': categoryText, 'filter_item': labelText, }); // Global Click Migration window.APLdigitalData.push({ 'event': 'click', 'event_category': 'engagements', 'event_location': 'Filter: '+ categoryText, 'event_action': 'filter_click', 'event_label': labelText, 'click_url': 'Results: ' + countProducts }); }); // sort change $(document).on('input', '#FacetSortForm', function() { const target = this; const sortSelect = target.querySelector('#SortBy'); const activeSortOption = sortSelect.querySelector('option:checked'); const activeSortLabel = elementText(activeSortOption); const elCount = document.querySelector('#ProductCountDesktop'); if (!elCount) return; const countProducts = parseInt(elCount.textContent, 10); if (!countProducts) return; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'sort_click', 'sort_type': activeSortLabel, }); // Global Click Migration window.APLdigitalData.push({ 'event': 'click', 'event_category': 'engagements', 'event_location': 'Results:' + countProducts, 'event_action': 'sort_click', 'event_label': activeSortLabel, 'click_url': '' }); }); // add to cart window.adobeTrackAddToCart = function(opts) { opts = opts || {}; const items = opts.items || []; const context = opts.context || ''; const $trigger = opts.$trigger || null; const triggerText = opts.triggerText || null; const triggerUrl = opts.triggerUrl || ''; return adobeCartData().then(function(trackCartData) { const trackingProducts = []; items.forEach(function(item) { const productData = trackCartData.items.find(function(cartItem) { return cartItem.variant_id === parseInt(item.id); }); if (!productData) return; // Extract bundle information from payload const bundleInfo = { bundle_added: productData.payload.bundle_added || false, bundle_name: productData.payload.bundle_name || null, bundle_mpn_id: productData.payload.bundle_mpn_id || null }; // Use bundle mpn_id if bundle is added, otherwise use product mpn_id const finalMpnId = bundleInfo.bundle_added && bundleInfo.bundle_mpn_id ? bundleInfo.bundle_mpn_id : productData.payload.mpn_id; trackingProducts.push({ units: item.quantity, product_name: productData.payload.product_name, mpn_id: finalMpnId, currency: productData.payload.currency, product_price: productData.payload.product_price, brand: productData.payload.brand, lob: productData.payload.lob, sub_lob: productData.payload.sub_lob, bundle_added: bundleInfo.bundle_added, bundle_name: bundleInfo.bundle_name }); }); let clickText; if (triggerText) { clickText = triggerText; } else { clickText = elementText($trigger); } const finalObj = { 'event': 'scAdd', 'product': trackingProducts, 'click_text': clickText, 'click_url': triggerUrl || '', 'add_to_cart_context': context, }; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push(finalObj); }).catch(function(err) { console.error('Error in adobeTrackAddToCart:', err); }) // first add-to-cart detection (MOVED INSIDE FUNCTION) const adobeTrackedFirstAdd = trackCartData.items.every(cartItem => items.some( item => parseInt(item.id) === parseInt(cartItem.variant_id) && parseInt(item.quantity) === parseInt(cartItem.quantity) ) ); if (adobeTrackedFirstAdd) { window.APLdigitalData.push({ event: 'scOpen', product: trackingProducts, add_to_cart_context: context }); } }; // view cart (function() { 'use strict'; // Check if we're on the cart page if (window.SDG && window.SDG.Data && window.SDG.Data.template === 'cart') { // Wait for Shopify consent to be granted const waitForConsent = function() { return new Promise(function(resolve) { const intervalId = setInterval(function() { if (window._shopifyConsentGranted === true) { clearInterval(intervalId); resolve(); } }, 100); }); }; // Track cart view waitForConsent().then(function() { console.log("Consent granted! Proceeding to fetch cart data for scView."); return adobeCartData(); }).then(function(trackCartData) { console.log("Cart data successfully fetched:", trackCartData); // Map cart data with bundle information const trackingProducts = trackCartData.items.map(function(item) { // Use bundle mpn_id if bundle is added, otherwise use product mpn_id const finalMpnId = item.payload.bundle_added && item.payload.bundle_mpn_id ? item.payload.bundle_mpn_id : item.payload.mpn_id; return { units: item.quantity, product_name: item.payload.product_name, mpn_id: finalMpnId, currency: item.payload.currency, product_price: item.payload.product_price, brand: item.payload.brand, lob: item.payload.lob, sub_lob: item.payload.sub_lob, bundle_added: item.payload.bundle_added || false, bundle_name: item.payload.bundle_name || null }; }); // Push the 'scView' event to the digital data layer window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'scView', product: trackingProducts }); console.log("scView event pushed to the DataLayer successfully:", { event: 'scView', product: trackingProducts }); }).catch(function(error) { console.error("Error while processing scView event:", error); }); } })() // scRemove - Remove from Cart Tracking ;(function() { 'use strict'; if (typeof jQuery !== 'undefined') { jQuery(document).on('click', '.cart-item cart-remove-button', function() { const target = this; const parent = target.closest('.cart-item'); const dataElement = parent.querySelector('.adobe-analytics-cart-item-data'); if (!dataElement) return; const productData = JSON.parse(dataElement.textContent); // Extract bundle information from product data const bundleInfo = { bundle_added: productData.payload.bundle_added || false, bundle_name: productData.payload.bundle_name || null, bundle_mpn_id: productData.payload.bundle_mpn_id || null }; // Use bundle mpn_id if bundle is added, otherwise use product mpn_id const finalMpnId = bundleInfo.bundle_added && bundleInfo.bundle_mpn_id ? bundleInfo.bundle_mpn_id : productData.payload.mpn_id; const trackingProducts = [{ units: productData.quantity, product_name: productData.payload.product_name, mpn_id: finalMpnId, currency: productData.payload.currency, product_price: productData.payload.product_price, brand: productData.payload.brand, lob: productData.payload.lob, sub_lob: productData.payload.sub_lob, bundle_added: bundleInfo.bundle_added, bundle_name: bundleInfo.bundle_name }]; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ event: 'scRemove', product: trackingProducts }); const mainProductIndex = parent.id.split('-')[1]; const appleCareRemoves = document.querySelectorAll('cart-remove-button[data-mnprdctidx="' + mainProductIndex + '"] .applecareremove-a'); appleCareRemoves.forEach(function(appleCareRemove) { if (typeof trackRemoveAppleCare === 'function') { trackRemoveAppleCare(appleCareRemove); } }); }); } })(); // collection slider product list section impression function productListImpressions() { const observerOptions = { threshold: 0.9, }; let products = []; const debouncedPushData = debounce(function() { if (!products.length) return; window.APLdigitalData = window.APLdigitalData || []; window.APLdigitalData.push({ 'event': 'product_list_section_impression', 'product': products, }); products = []; }, 10); function observerCallback(entries, observer) { entries.forEach(entry => { if (entry.isIntersecting) { const slickParent = entry.target; const numSlides = $(slickParent).slick('getSlick').slideCount; const $cards = slickParent.querySelectorAll('.product-card, .item-card'); const $activeCards = slickParent.querySelectorAll('.product-card.slick-active, .item-card.slick-active'); const activeCardIndices = Array.from($activeCards).map(card => Array.from($cards).indexOf(card) % numSlides); slickParent.dataset.activeCardIndices = activeCardIndices.join(','); $activeCards.forEach($card => { const productData = JSON.parse($card.querySelector('.adobe-analytics-product-card-data').textContent); products.push(productData); }); debouncedPushData(); } }); } const observer = new IntersectionObserver(observerCallback, observerOptions); const $productLists = document.querySelectorAll('.collection_slider .slick-initialized:not(.is-observed), .conversion-module .slick-initialized:not(.is-observed)'); $productLists.forEach($productList => { observer.observe($productList); $productList.classList.add('is-observed'); const slickParent = $productList; if (slickParent) { $(slickParent).on('afterChange', function() { const numSlides = $(slickParent).slick('getSlick').slideCount; const $cards = slickParent.querySelectorAll('.product-card, .item-card'); const $activeCards = slickParent.querySelectorAll('.product-card.slick-active, .item-card.slick-active'); const previousActiveCardIndices = slickParent.dataset.activeCardIndices?.split(',').map(index => parseInt(index)); if (!previousActiveCardIndices) return; const activeCardIndices = Array.from($activeCards).map(card => Array.from($cards).indexOf(card) % numSlides); const newActiveCardIndices = activeCardIndices.filter(index => !previousActiveCardIndices.includes(index)); const $newActiveCards = Array.from($cards).filter((card, index) => newActiveCardIndices.includes(index)); slickParent.dataset.activeCardIndices = activeCardIndices.join(','); $newActiveCards.forEach($card => { const productData = JSON.parse($card.querySelector('.adobe-analytics-product-card-data').textContent); products.push(productData); }); debouncedPushData(); }); } }); } productListImpressions(); window.adobeTrackProductListImpressions = productListImpressions; }); // tryWireEvents(); //})(); });