{"webLayers":[{"_id":"65969a5c8c5eb0116fb13e53","date_filter":{"enabled":false,"from_date":null,"to_date":null},"trigger":{"include_pages":[{"type":"any"}],"exclude_pages":null},"device_target":{"type":"any"},"frequency":"until_visitor_interacts","uses_personalization":true,"data":"","variables_target":null,"page_vars":[]},{"_id":"67445c4ccf6b1db404133d8a","date_filter":{"enabled":false,"from_date":null,"to_date":null},"trigger":{"include_pages":[{"url":"cartrepop","type":"contains"}],"exclude_pages":[{"url":"cdn.exp.","type":"contains"}]},"device_target":{"type":"any"},"frequency":"always","uses_personalization":false,"data":"return (function insertBanner(data) {\ninsertBanner.inPreview = false;\ninsertBanner.sdk = window.exponea;\ninsertBanner.data = data;\ninsertBanner.html = \"\";\ninsertBanner.style = \"\";\ninsertBanner.script = function() { console.log(\"NON-PERSO WEBLAYER\");\r\n\r\nlet eventUrl = window.location.href;\r\nlet urlObj = new URL(eventUrl);\r\nlet baseEventUrl = urlObj.origin;\r\nlet hashFragment = urlObj.hash;\r\n\r\nif (!baseEventUrl.includes('pandora.net')) {\r\n    console.error(\"Base URL does not contain 'pandora.net'. Redirection skipped.\");\r\n} else {\r\n    let pathSegments = urlObj.pathname.split('/').filter(segment =\u003e segment);\r\n    let firstSegment = pathSegments[0];\r\n    let isLanguageSegment = /^[a-z]{2}$/i.test(firstSegment); // Two-letter language code check\r\n\r\n    if (isLanguageSegment) {\r\n        baseEventUrl += `/${firstSegment}`;\r\n    } else {\r\n        if (eventUrl.includes('https://us.pandora.net/') || eventUrl.includes('https://ca.pandora.net/')) {\r\n            baseEventUrl += `/en`;\r\n        }\r\n    }\r\n\r\n    baseEventUrl += \"/basketrepop\";\r\n\r\n    let urlParams = urlObj.searchParams;\r\n    let basketRepopValue = urlParams.get(\"cartrepop\");\r\n\r\n    if (basketRepopValue) {\r\n        let items = basketRepopValue.split('*');\r\n        let cartProducts = items.map(item =\u003e item.replace('%3D', '=')).join('\u0026');\r\n\r\n        if (eventUrl.includes(\"cartrepop\")) {\r\n            let cleanUrl = eventUrl.split(\"cartrepop\")[0].slice(0, -1); // Remove trailing \"\u0026\" or \"?\"\r\n\r\n            let destUrlObj = new URL(cleanUrl);\r\n            let destPathSegments = destUrlObj.pathname.split('/').filter(segment =\u003e segment);\r\n            let destIsLang = destPathSegments.length === 1 \u0026\u0026 /^[a-z]{2}$/i.test(destPathSegments[0]);\r\n\r\n            if (destIsLang) {\r\n                cleanUrl = destUrlObj.origin;\r\n            }\r\n\r\n            let finalUrl = `${baseEventUrl}?${cartProducts}\u0026dest=${encodeURIComponent(cleanUrl)}`;\r\n            if (hashFragment) {\r\n                finalUrl += hashFragment;\r\n            }\r\n\r\n            console.log(finalUrl);\r\n            window.location.href = finalUrl;\r\n        }\r\n    } else {\r\n        console.log(\"No basketrepop value found, skipping redirection.\");\r\n    }\r\n}\r\n };\ninsertBanner.remove = (insertBanner.script.call(insertBanner) || {} ).remove;\ninsertBanner.contextual_personalization = {};\nreturn insertBanner;\n})({\"banner_id\": \"67445c4ccf6b1db404133d8a\", \"banner_name\": null, \"banner_type\": \"medium_rectangle\", \"banner_group\": \"\", \"variant_id\": 0, \"variant_name\": \"Variant A\"});","variables_target":null,"page_vars":[]},{"_id":"68c5cd63dba7117fb5d4fd22","date_filter":{"enabled":false,"from_date":1762189200,"to_date":null},"trigger":{"include_pages":[{"url":"us.pandora.net","type":"contains"}],"exclude_pages":[{"url":"lab-grown-diamond","type":"contains"}]},"device_target":{"type":"any"},"frequency":"always","uses_personalization":true,"data":"","variables_target":{"conditions":[{"attribute":{"id":"691481c5f44856ec5904bec7","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"PLP"}],"operator":"in","type":"string"}}]},"page_vars":[{"id":"691481c5f44856ec5904bec7"}]},{"_id":"68c9855a74641461c6950a5f","date_filter":{"enabled":false,"from_date":1762189200,"to_date":null},"trigger":{"include_pages":[{"url":"us.pandora.net","type":"contains"}],"exclude_pages":[{"url":"lab-grown-diamond","type":"contains"}]},"device_target":{"type":"any"},"frequency":"always","uses_personalization":true,"data":"","variables_target":{"conditions":[{"attribute":{"id":"691481c5f44856ec5904bec7","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"PDP"}],"operator":"in","type":"string"}}]},"page_vars":[{"id":"691481c5f44856ec5904bec7"},{"id":"68c5963baf0d001c20dd9e10"}]},{"_id":"68f7421be15d8cb506577e31","date_filter":{"enabled":false,"from_date":1762189200,"to_date":null},"trigger":{"include_pages":[{"url":"us.pandora.net","type":"contains"}],"exclude_pages":[{"url":"lab-grown-diamond","type":"contains"}]},"device_target":{"type":"any"},"frequency":"always","uses_personalization":true,"data":"","variables_target":{"conditions":[{"attribute":{"id":"691481c5f44856ec5904bec7","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"PDP"}],"operator":"in","type":"string"}},{"attribute":{"id":"691f5b647189096a8b92b9b3","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"null"}],"operator":"does not equal","type":"string"}}]},"page_vars":[{"id":"691f5b647189096a8b92b9b3"},{"id":"691481c5f44856ec5904bec7"}]},{"_id":"68fa0772c4e08c1e082629f8","date_filter":{"enabled":false,"from_date":null,"to_date":null},"trigger":{"include_pages":[{"url":"ca.pandora.net/en/","type":"contains"}],"exclude_pages":[{"url":"lab-grown-diamond","type":"contains"}]},"device_target":{"type":"any"},"frequency":"always","uses_personalization":true,"data":"","variables_target":{"conditions":[{"attribute":{"id":"691481c5f44856ec5904bec7","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"PDP"}],"operator":"in","type":"string"}},{"attribute":{"id":"691f5b647189096a8b92b9b3","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"null"}],"operator":"does not equal","type":"string"}}]},"page_vars":[{"id":"691f5b647189096a8b92b9b3"},{"id":"691481c5f44856ec5904bec7"}]},{"_id":"68fa128ed4962f5ff90dc5b7","date_filter":{"enabled":false,"from_date":null,"to_date":null},"trigger":{"include_pages":[{"url":"ca.pandora.net/fr/","type":"contains"}],"exclude_pages":[{"url":"lab-grown-diamond","type":"contains"}]},"device_target":{"type":"any"},"frequency":"always","uses_personalization":true,"data":"","variables_target":{"conditions":[{"attribute":{"id":"691481c5f44856ec5904bec7","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"PDP"}],"operator":"in","type":"string"}},{"attribute":{"id":"691f5b647189096a8b92b9b3","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"null"}],"operator":"does not equal","type":"string"}}]},"page_vars":[{"id":"691481c5f44856ec5904bec7"},{"id":"691f5b647189096a8b92b9b3"}]},{"_id":"68fa166ea673e4a5048f8826","date_filter":{"enabled":false,"from_date":null,"to_date":null},"trigger":{"include_pages":[{"url":"ca.pandora.net/en/","type":"contains"}],"exclude_pages":[{"url":"lab-grown-diamond","type":"contains"}]},"device_target":{"type":"any"},"frequency":"always","uses_personalization":true,"data":"","variables_target":{"conditions":[{"attribute":{"id":"691481c5f44856ec5904bec7","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"PDP"}],"operator":"in","type":"string"}}]},"page_vars":[{"id":"691481c5f44856ec5904bec7"}]},{"_id":"68fa182921ddd81e2b2b3397","date_filter":{"enabled":false,"from_date":null,"to_date":null},"trigger":{"include_pages":[{"url":"ca.pandora.net/fr/","type":"contains"}],"exclude_pages":[{"url":"lab-grown-diamond","type":"contains"}]},"device_target":{"type":"any"},"frequency":"always","uses_personalization":true,"data":"","variables_target":{"conditions":[{"attribute":{"id":"691481c5f44856ec5904bec7","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"PDP"}],"operator":"in","type":"string"}}]},"page_vars":[{"id":"691481c5f44856ec5904bec7"}]},{"_id":"68fa265a5140c7cc2f24a726","date_filter":{"enabled":false,"from_date":null,"to_date":null},"trigger":{"include_pages":[{"url":"ca.pandora.net/en/","type":"contains"}],"exclude_pages":[{"url":"lab-grown-diamond","type":"contains"}]},"device_target":{"type":"any"},"frequency":"always","uses_personalization":true,"data":"","variables_target":{"conditions":[{"attribute":{"id":"691481c5f44856ec5904bec7","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"PLP"}],"operator":"in","type":"string"}}]},"page_vars":[{"id":"691481c5f44856ec5904bec7"}]},{"_id":"68fa2d49e951014a561c24bb","date_filter":{"enabled":false,"from_date":null,"to_date":null},"trigger":{"include_pages":[{"url":"ca.pandora.net/fr/","type":"contains"}],"exclude_pages":[{"url":"lab-grown-diamond","type":"contains"}]},"device_target":{"type":"any"},"frequency":"always","uses_personalization":true,"data":"","variables_target":{"conditions":[{"attribute":{"id":"691481c5f44856ec5904bec7","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"PLP"}],"operator":"in","type":"string"}}]},"page_vars":[{"id":"691481c5f44856ec5904bec7"}]},{"_id":"69412a2de909a56e783acf73","date_filter":{"enabled":false,"from_date":1762189200,"to_date":null},"trigger":{"include_pages":[{"url":"us.pandora.net","type":"contains"}],"exclude_pages":[{"url":"lab-grown-diamond","type":"contains"}]},"device_target":{"type":"any"},"frequency":"always","uses_personalization":true,"data":"","variables_target":{"conditions":[{"attribute":{"id":"691481c5f44856ec5904bec7","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"PLP"}],"operator":"in","type":"string"}}]},"page_vars":[{"id":"691481c5f44856ec5904bec7"}]},{"_id":"69e2358b869820691ae6e432","date_filter":{"enabled":false,"from_date":null,"to_date":null},"trigger":{"include_pages":[{"url":"us.pandora.net","type":"contains"}],"exclude_pages":null},"device_target":{"type":"any"},"frequency":"always","uses_personalization":true,"data":"","variables_target":{"conditions":[{"attribute":{"id":"691481c5f44856ec5904bec7","type":"page_variable"},"constraint":{"operands":[{"type":"constant","value":"PLP"},{"type":"constant","value":"PDP"}],"operator":"in","type":"string"}}]},"page_vars":[]}],"experiments":[],"constantManagedTags":[{"uses_overlay":false,"type":"js","parametrized_definition":"console.log(\"tester is true\");\nexponea.identify({}, { tester: true }, function() {\n\t const currentUrl = window.location.href.split('?')[0]\n\twindow.open(currentUrl, \"_top\")\t\n}, function() {\n});\n","trigger":{"include_pages":[{"url":"exp_tag=63ca9b2abc6a37b9894e33f4","type":"contains"}],"exclude_pages":null},"_id":"6715faf091db159142db9b98"},{"uses_overlay":false,"type":"js","parametrized_definition":"if (window.location.href.includes('#EmailAddToCart')) {\n    const btnAddToCart = document.querySelector('[data-auto=\"btnAddToCart\"]');\n    if (btnAddToCart) {\n        btnAddToCart.click();\n    }\n}","trigger":{"include_pages":[{"url":"#EmailAddToCart","type":"contains"}],"exclude_pages":null},"_id":"6964f50157253efdec517c8f"}],"vars":{"data":[{"id":"650dbb76a896a81a7d33bafc","name":"page.type","variable":{"type":"global_variable","global_variable":{"name":"utag_data.page_type"}}},{"id":"650dbbac80f2dc0f97b99620","name":"Number of visits","variable":{"type":"custom_function","custom_function":{"body":"if (!exponea.cookie) {\n\t// Cookie toolkit\n\texponea.cookie = {\n\t\t// Set cookie, optional expiraton argument\n\t\tset: function (cname, cvalue, exdays) {\n\t\t\tif (exdays) {\n\t\t\t\tvar d = new Date();\n\t\t\t\td.setTime(d.getTime() + exdays * 24 * 60 * 60 * 1000);\n\t\t\t\tvar expires = \"expires=\" + d.toUTCString();\n\t\t\t\tdocument.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n\t\t\t} else {\n\t\t\t\tdocument.cookie = cname + \"=\" + cvalue + \";path=/\";\n\t\t\t}\n\t\t},\n\t\t// Get cookie by name\n\t\tget: function (cname) {\n\t\t\tvar name = cname + \"=\";\n\t\t\tvar decodedCookie = decodeURIComponent(document.cookie);\n\t\t\tvar ca = decodedCookie.split(\";\");\n\t\t\tfor (var i = 0; i \u003c ca.length; i++) {\n\t\t\t\tvar c = ca[i];\n\t\t\t\twhile (c.charAt(0) == \" \") {\n\t\t\t\t\tc = c.substring(1);\n\t\t\t\t}\n\t\t\t\tif (c.indexOf(name) == 0) {\n\t\t\t\t\treturn c.substring(name.length, c.length);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn \"\";\n\t\t},\n\t};\n}\n\nvar numberOfVisits = (parseInt(exponea.cookie.get(\"exponea_page_visits\")) || 0) + 1;\nexponea.cookie.set(\"exponea_page_visits\", numberOfVisits);\n\nvar currentTimestamp = (new Date().getTime()) / 1000;\nvar sessionStartTimestamp = parseFloat(exponea.cookie.get(\"exponea_first_page_visit_timestamp\")) || currentTimestamp;\n\n// save the session start timestamp\nif (numberOfVisits === 1) {\n\texponea.cookie.set(\"exponea_first_page_visit_timestamp\", currentTimestamp);\n}\n\nreturn numberOfVisits;"}}},{"id":"68c5961f51b43359b4bb620f","name":"[CA] PLP Recos Plus","variable":{"type":"custom_function","custom_function":{"body":"console.log(\"PV Tag run, page type:\", utag_data?.page_type);\n\nif (\n  utag_data?.page_type === \"category\" \u0026\u0026\n  utag_data.products?.length \u003e 0\n) {\n  console.log(\"Has page pv type, setting data\");\n\n  // 🔹 Always refresh exponea data\n  exponea.utag_data = {\n    product_id: utag_data.products[0].master_id,\n    category: utag_data.product_category?.[0] || \"\",\n    mode: \"personalized_for_you\",\n    currentcategory: utag_data.page_content_type,\n    currentdevice: utag_data.user_device_type,\n  };\n\n  console.log(\"exponea.utag_data pv\", exponea.utag_data);\n\n  // 🔹 Add placeholder element so Tag Manager weblayer can render into it\n  if (!document.querySelector(\".pfy-plp\")) {\n    const container = document.createElement(\"div\");\n    container.className = \"pfy-plp\";\n    document.body.appendChild(container);\n    console.log(\"Injected new .pfy-plp container\");\n  }\n\n  return true;\n}\n\nconsole.log(\"Conditions not met, stopping\");\nreturn false;"}}},{"id":"68c5963baf0d001c20dd9e10","name":"[CA, US] PDP Reco Plus","variable":{"type":"custom_function","custom_function":{"body":"console.log(\"PV PDP run, page_type:\", utag_data?.page_type);\n\n// Require gemini platform/experience\nconst isGemini = (utag_data?.platform === \"gemini\") || (utag_data?.experience === \"gemini\");\nif (!isGemini) {\n  console.log(\"Not gemini (platform/experience), stopping\");\n  return false;\n}\n\n// Basic guards\nconst products = Array.isArray(utag_data?.products) ? utag_data.products : [];\nif (!utag_data?.page_type || (!exponea.utag_data \u0026\u0026 products.length === 0)) {\n  console.log(\"Missing page_type or no products and no exponea.utag_data yet, stopping\");\n  return false;\n}\n\n// 🔹 Remove old banner(s) if any exist\nconst oldBanners = document.querySelectorAll(\".pfy-pdp\");\nif (oldBanners.length \u003e 0) {\n  console.log(`Removing ${oldBanners.length} existing .pfy-pdp element(s)`);\n  oldBanners.forEach(banner =\u003e banner.remove());\n}\n\n\n// Must be PDP\nif (utag_data.page_type !== \"product\") {\n  console.log(\"Page type not product, stopping\");\n  return false;\n}\n\n// Exclude diamond collections\nconst hasDiamond = products.some(p =\u003e {\n    const col = (p?.collection || \"\").toString().toLowerCase();\n    return col.includes(\"diamond\");\n});\nif (hasDiamond) {\n    console.log(\"Diamond collection detected, stopping\");\n    return false;\n}\n\n// Prepare context for weblayers\nconst first = products[0] || {};\nexponea.utag_data = exponea.utag_data || {\n    product_id: first.master_id,\n    category: (utag_data?.product_category \u0026\u0026 utag_data.product_category[0]) || utag_data?.page_content_type,\n    currentcategory: utag_data?.page_content_type,\n    currentdevice: utag_data?.user_device_type,\n};\n\nconsole.log(\"exponea.utag_data (PDP PV) is true:\", exponea.utag_data);\nreturn true;"}}},{"id":"68c949e3f7b5edb20b377113","name":"[US] PLP Recos - RecoPlus (Mobile)","variable":{"type":"custom_function","custom_function":{"body":"function checkMobile() {\n  let check = false;\n  (function(a) {\n    if (\n      /(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) ||\n      /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4))\n    ) check = true;\n  })(navigator.userAgent || navigator.vendor || window.opera);\n  return check;\n}\n\nconsole.log(\"PV Tag run, page type:\", utag_data?.page_type);\n\nif (!checkMobile()) {\n  console.log(\"Not mobile, stopping\");\n  return false;\n}\n\nif (\n  utag_data?.page_type === \"category\" \u0026\u0026\n  utag_data.products?.length \u003e 0\n) {\n  console.log(\"Has page pv type, setting data\");\n\n  // 🔹 Remove old banner if it exists\n  const oldBanner = document.querySelector(\".pfy-plp\");\n  if (oldBanner) {\n    console.log(\"Removing existing .pfy-plp element\");\n    oldBanner.remove();\n  }\n\n  // 🔹 Always refresh exponea data\n  exponea.utag_data = {\n    product_id: utag_data.products[0].master_id,\n    category: utag_data.product_category?.[0] || \"\",\n    mode: \"personalized_for_you\",\n    currentcategory: utag_data.page_content_type,\n    currentdevice: utag_data.user_device_type,\n  };\n\n  console.log(\"exponea.utag_data pv is true\", exponea.utag_data);\n\n  return true;\n}\n\nconsole.log(\"Conditions not met, stopping\");\nreturn false;"}}},{"id":"6913536674b4c6f98366ef6a","name":"test.page.type","variable":{"type":"custom_function","custom_function":{"body":"function getPandoraPageType() {\n  const url = window.location.href;\n  const path = window.location.pathname;\n \n  // Exclude homepage (if path == / or /en or /es/)\n  if (path === '/' || path.replaceAll(\"/\", \"\").length == 2) {\n    return \"home\";\n  }\n \n  // Detect PDP (Product Detail Page) — ends with .html\n  if (/\\/[a-z0-9-]+\\/[a-z0-9-]+\\.html$/i.test(path)) {\n    return 'PDP';\n  }\n \n  // Detect PLP (Product Listing Page)\n  // Pattern: category pages like /en/charms/dangle-charms/ or /en/collections/pandora-signature/\n  if (/^\\/[\\w]{2}\\/[a-z0-9-]+(\\/[a-z0-9-]+)*\\/?$/i.test(path) \u0026\u0026 !url.includes('.html')) {\n    return 'PLP';\n  }\n \n  // Ignore all other pages\n  return null;\n}\n\nconsole.log(`getPandoraPageType: ${getPandoraPageType()}, utag_data.page_type: ${window.utag_data.page_type}, utag.data.page_type: ${window.utag.data.page_type}`)\n\nreturn getPandoraPageType();"}}},{"id":"691481c5f44856ec5904bec7","name":"Page Type Identification PDP or PLP","variable":{"type":"custom_function","custom_function":{"body":"console.log(\"Page Type Identification PDP or PLP is running on the page\");\nfunction getPandoraPageType() {\n  const url = window.location.href;\n  const path = window.location.pathname;\n \n  // Exclude homepage (if path == / or /en or /es/)\n  if (path === '/' || path.replaceAll(\"/\", \"\").length == 2) {\n    return \"home\";\n  }\n \n  // Detect PDP (Product Detail Page) — ends with .html\n  if (/\\/[a-z0-9-]+\\/[a-z0-9-]+\\.html$/i.test(path)) {\n    console.log(\"PDP Page Found\");\n    return 'PDP';\n  }\n \n  // Detect PLP (Product Listing Page)\n  // Pattern: category pages like /en/charms/dangle-charms/ or /en/collections/pandora-signature/\n  if (/^\\/[\\w]{2}\\/[a-z0-9-]+(\\/[a-z0-9-]+)*\\/?$/i.test(path) \u0026\u0026 !url.includes('.html')) {\n    console.log(\"PLP Page Found\");\n    return 'PLP';\n  }\n \n  // Ignore all other pages\n  return null;\n}\n\nconsole.log(`getPandoraPageType: ${getPandoraPageType()}, utag_data.page_type: ${window.utag_data.page_type}, utag.data.page_type: ${window.utag.data.page_type}`)\n\nreturn getPandoraPageType();"}}},{"id":"691f5b647189096a8b92b9b3","name":"PDP Product Identifier","variable":{"type":"custom_function","custom_function":{"body":"console.log(\"PDP Product ID extraction running\");\n\nfunction getPdpProductId() {\n  const path = window.location.pathname;\n\n  // Match PDP URL ending with .html and extract product ID\n  const pdpMatch = path.match(/\\/[a-z0-9-]+\\/([a-z0-9-’']+)\\.html$/i);\n  if (pdpMatch) {\n    return pdpMatch[1]; // extracted product ID\n  }\n\n  return null; // Not a PDP page\n}\n\nconst productId = getPdpProductId();\nconsole.log(\"Extracted PDP Product ID:\", productId);\nreturn productId;"}}},{"id":"69d6493aefb1aa9e0572d0c4","name":"Page Type Identification PDP or PLP (Shop/Discover Tab)","variable":{"type":"custom_function","custom_function":{"body":"console.log(\"Page Type Identification PDP or PLP is running on the page\");\nfunction getPandoraPageType() {\n    const url = window.location.href;\n    const path = window.location.pathname;\n    // Exclude homepage (if path == / or /en or /es/)\n    if (path === '/' || path.replaceAll(\"/\", \"\").length == 2) {\n        return \"home\";\n    }\n    // Detect PDP (Product Detail Page) — ends with .html\n    if (/\\/[a-z0-9-]+\\/[a-z0-9-]+\\.html$/i.test(path)) {\n        console.log(\"PDP Page Found\");\n        return 'PDP';\n    }\n    // Detect PLP (Product Listing Page)\n    // Pattern: category pages like /en/charms/dangle-charms/ or /en/collections/pandora-signature/\n    if (/^\\/[\\w]{2}\\/[a-z0-9-]+(\\/[a-z0-9-]+)*\\/?$/i.test(path) \u0026\u0026 !url.includes('.html')) {\n        console.log(\"PLP Page Found\");\n\n        // Hide recos on Discover tab\n        const discoverTab = document.querySelector('[data-auto=\"btnDiscoverTab\"][aria-selected=\"true\"]');\n        if (discoverTab) {\n            console.log(\"Discover tab is active - hiding recos\");\n            return null;\n        }\n\n        console.log(\"Discover tab element:\", discoverTab);\n\n        return 'PLP';\n    }\n    // Ignore all other pages\n    return null;\n}\nconsole.log(`getPandoraPageType: ${getPandoraPageType()}, utag_data.page_type: ${window.utag_data.page_type}, utag.data.page_type: ${window.utag.data.page_type}`)\nreturn getPandoraPageType();"}}}]}}