糖心原创

(see the * 'adobe' handle in functions.php — no async, no defer), so a page-load * Target offer has already set `data-hdr` by the time this runs. * * An answer that lands after this point is inert rather than acted on: * `apply()` finds the prune settled and does nothing, so the visitor * keeps the nav they were served instead of watching it change. That is * the deliberate trade-off — a late activity collects no data, but no * visitor ever sees the wrong nav or waits for the right one. */ (function () { var VARIANTS = ["a","b","c"]; var DEFAULT = "a"; /** * QA-only. When the on-page switcher is drawn we keep every variant in * the DOM so it can toggle between them live and you can see that the * chrome never repaints. Gated by the same constant as the switcher, so * it is false everywhere the switcher is absent — including production. */ var QA_KEEP_ALL = false; var root = document.documentElement; var settled = false; function valid(v) { return VARIANTS.indexOf(v) !== -1; } /** Publish the decision and let the nav JS bind. */ function finish(active) { root.setAttribute('data-hdr', active); // Read by the Adobe Analytics client to attribute the test. root.setAttribute('data-hdr-active', active); if (typeof window.initHeaderNav === 'function') window.initHeaderNav(); /** * `variant` is set before the event so late listeners can tell * "already done" from "not yet". main.js is enqueued in the footer * and therefore always misses the event itself. */ window.medalliaNav.variant = active; document.dispatchEvent(new CustomEvent('medallia:nav-ready', { detail: { variant: active } })); } function prune(active) { if (settled) return; settled = true; if (QA_KEEP_ALL) { finish(active); return; } /** * Only menu items carry data-nav-variant, so this can never touch * the shared chrome. CSS has already hidden the losers; removing * them keeps document.querySelector-based nav JS unambiguous. */ var list = document.querySelectorAll('#site-header [data-nav-variant]'); for (var i = 0; i < list.length; i++) { if (list[i].getAttribute('data-nav-variant') !== active) { list[i].parentNode.removeChild(list[i]); } } finish(active); } window.medalliaNav = { variant: null, apply: function (v) { if (valid(v)) prune(v); } }; // `?hv=` sets this server-side; a Target offer in the blocking // embed sets it before the body is parsed. var pre = root.getAttribute('data-hdr'); if (valid(pre)) { prune(pre); return; } /** * Carried forward from an earlier pageview. Read client-side, never in * PHP: WP Engine does not vary its page-cache key on arbitrary cookies, * so server-side personalisation here would serve the first anonymous * visitor's variant to everyone. */ var m = document.cookie.match(/(?:^|; )medallia_nav_variant=([^;]*)/); if (m && valid(m[1])) { prune(m[1]); return; } prune(DEFAULT); })();

Justin Herrick

Da giornalista tecnologico diventato professionista del marketing, la naturale curiosità di Justin nell'esplorare settori particolari gli permette di scoprire come experience management un ruolo fondamentale nel processo decisionale delle organizzazioni.

29 giugno 2023

Customer Experience

10 modi migliori per aumentare i tassi di risposta ai sondaggi

Scoprite strategie e suggerimenti efficaci per aumentare i tassi di risposta alle indagini, ottimizzare la progettazione delle indagini e raccogliere...

13 marzo 2023

Customer Experience

Customer Experience Esperienza del cliente vs. Servizio clienti: in cosa differiscono (e in cosa sono collegati)

Customer experience e il servizio clienti sono due cose diverse, ma collegarle tra loro permette ai marchi di soddisfare...

10 marzo 2023

Customer Experience

Customer Experience Software di gestione dell'esperienza del cliente (CEM): le 9 caratteristiche principali per scegliere una piattaforma

Scopri le caratteristiche principali per scegliere la migliore customer experience (CEM)…

15 febbraio 2023

Customer Experience

Gestione delle recensioni online: Strategia per i siti di recensioni e i social media

Cosa dicono i clienti del vostro marchio sui siti di recensioni e sui social media? Ecco tutto...

7 dicembre 2021

Customer Experience

Come rispondere correttamente alle recensioni negative online sulla vostra azienda

Date un'occhiata alle recensioni online della vostra attività. Sia le recensioni positive che quelle negative sono condivise...

24 agosto 2021

Contact Center

Cos'è il sentiment dei clienti (e perché è necessario misurarlo)?

Il 64% dei consumatori dichiara di voler smettere di fare affari con un marchio dopo solo due o...