and runs during HTML parse, but hubspotutk is set by js.hs-analytics.net, measured loading at ~834ms. On a first visit the cookie does not exist yet, so a single read returns nothing and the visitor gets no external ID at all — and a first visit is exactly what an ad click is. So poll briefly until HubSpot sets it. The SDK loads lazily (~4.5s) and replays a queue, so an init queued a second or two in still lands before any events are transmitted. */ (function attachExternalId() { var attempts = 0; var MAX_ATTEMPTS = 40; /* 40 x 200ms = 8s, then give up quietly */ var timer = null; function tryAttach() { var raw = getExternalId(); if (!raw) { if (++attempts >= MAX_ATTEMPTS && timer) clearInterval(timer); return; } if (timer) clearInterval(timer); sha256Hex(raw).then(function (hash) { oaiq("init", { user: { external_id_sha256: hash } }); }).catch(function () {}); } tryAttach(); /* returning visitor: immediate */ if (!getExternalId()) timer = setInterval(tryAttach, 200); })(); /* --------------------------------------------------------------------------- 2. Load the SDK off the critical path Whichever comes first: the main thread going idle after load, or the first sign of real user intent. No preconnect on purpose — a TLS handshake during LCP for a script we deliberately deferred is a net loss. Measured on clickpost.ai: load event 3614ms, SDK fetched 4508ms. ------------------------------------------------------------------------ */ var loaded = false; var INTENT = ["pointerdown", "keydown", "scroll"]; function loadSdk() { if (loaded) return; loaded = true; INTENT.forEach(function (t) { removeEventListener(t, loadSdk, { passive: true }); }); var s = document.createElement("script"); s.src = SDK; s.async = true; s.fetchPriority = "low"; document.head.appendChild(s); } INTENT.forEach(function (t) { addEventListener(t, loadSdk, { passive: true, once: true }); }); addEventListener("load", function () { window.requestIdleCallback ? requestIdleCallback(loadSdk, { timeout: 2500 }) : setTimeout(loadSdk, 1500); }, { once: true }); /* --------------------------------------------------------------------------- 3. Conversion id sha256(lowercase(email) + "|" + formId + "|" + ISO-hour), first 20 hex, "lead_" prefix. - email lowercased/trimmed so casing does not fork the id - formId keeps two different forms in the same hour from colliding - the hour bucket is only the server's fallback; the id computed here is sent to the relay verbatim, so the two paths cannot disagree even when a submit straddles an hour boundary Ads Manager's own sample omits event_id. We send it so the pixel event and the relay event collapse into one conversion instead of counting twice. ------------------------------------------------------------------------ */ function buildEventId(email, formId) { var seed = [ String(email || "").trim().toLowerCase(), String(formId || ""), new Date().toISOString().slice(0, 13) ].join("|"); return crypto.subtle.digest("SHA-256", new TextEncoder().encode(seed)).then(function (buf) { var hex = Array.prototype.map.call(new Uint8Array(buf), function (b) { return b.toString(16).padStart(2, "0"); }).join(""); return "lead_" + hex.slice(0, 20); }); } /* Guards a re-fire from the history.pushState that book-a-demo-core.js runs after submit, and from back-navigation onto the same state. */ function firedOnce(id) { try { if (sessionStorage.getItem("oaiq_" + id)) return true; sessionStorage.setItem("oaiq_" + id, "1"); return false; } catch (e) { return false; /* private mode / blocked storage: fire rather than lose it */ } } /* Path 2. keepalive lets the request finish even if the page navigates away. Failures are swallowed deliberately: a reporting call must never surface an error to someone who just submitted a form. The relay hashes the email server-side into user.emails_sha256 and adds the caller's IP and user agent, so this event carries the same match signals the pixel gets for free. */ function sendToRelay(email, formId, eventType, eventId) { try { var payload = { token: RELAY_TOKEN, email: email, form_id: formId || "", event_type: eventType, event_id: eventId, /* verbatim, so both paths always match */ source_url: location.href }; var oppref = getOppref(); if (oppref) payload.oppref = oppref; var externalId = getExternalId(); if (externalId) payload.external_id = externalId; fetch(RELAY_URL, { method: "POST", keepalive: true, headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload) }).catch(function () {}); } catch (e) {} } /* Capture the email while the form is still on the page. onFormSubmitted does not reliably carry submissionValues, and by then the form may be removed. */ var lastEmail = ""; document.addEventListener("submit", function (e) { var f = e.target; if (!f || !f.querySelector) return; var i = f.querySelector('input[name="email"], input[type="email"]'); if (i && i.value) lastEmail = i.value; }, true); /* Every HubSpot form on the site reports through this one message event, so no module or theme JS needs editing to add coverage. */ window.addEventListener("message", function (e) { var d = e.data; if (!d || d.type !== "hsFormCallback" || d.eventName !== "onFormSubmitted") return; var email = (d.data && d.data.submissionValues && d.data.submissionValues.email) || lastEmail; if (!email) return; /* without an email there is no stable id to dedupe on */ var eventType = EVENT_BY_FORM[d.id] || EVENT_DEFAULT; buildEventId(email, d.id).then(function (id) { if (firedOnce(id)) return; oaiq("measure", eventType, { type: DATA_TYPE }, { event_id: id }); /* path 1 */ sendToRelay(email, d.id, eventType, id); /* path 2 */ }); }); })();

91ÊÓÆµ

See where your logistics stands on automation Start assessment

Home > Blog >

Top 10 Customer Support & Helpdesk Tools for eCommerce in 2026

Top 10 Customer Support & Helpdesk Tools for eCommerce in 2026

Sathish Loganathan
By Sathish Loganathan
Tarunya Shankar
Reviewed by This article has been thoroughly reviewed, fact-checked, and compiled using comprehensive, up-to-date information provided by ClickPost — a trusted authority in logistics and eCommerce shipping solutions. Our editorial process ensures accuracy, relevance, and reliability for our readers. Tarunya Shankar

Ready to ship smarter? Talk to our logistics experts.

Trusted by 600+ brands

In this blog

    TL/DR Summary

    This article reviews 10 leading customer service tools, explaining how they fit into different support stacks and which types of ecommerce companies they best suit.

    Key pointers

    • Modern customer service software helps ecommerce businesses centralize customer messages from multiple channels and manage customer interactions on a single platform.

    • Strong help desk solutions rely on a knowledge base and self-service features so customers find answers without always contacting a support team.

    • Automation features, AI agent capabilities, and automated workflows reduce repetitive tasks and help support agents focus on higher-value customer issues.

    • Desk software with integrated support and rich customer context improves agent performance and makes it easier to deliver personalized support.

    • Many tools on this list, such as Tidio, Freshdesk, and Zoho Desk, offer a free plan so small teams can experiment before committing.

    • Enterprise-focused tools like Zendesk, HubSpot, and Salesforce add deeper customer relationship management links for complex ecommerce support needs.

    • Choosing the right desk platform is about aligning key features, pricing, and support stack complexity with the maturity of your e-commerce business.

    Customer support tools are no longer just ticketing add-ons; they are strategic systems that help commerce businesses manage customer conversations at scale, streamline support operations, and consistently deliver exceptional customer experiences. Selecting a platform that matches your support team size, support inquiries mix, and growth plans will pay off in happier customers, stronger loyalty, and more efficient customer success operations.

    Why Ecommerce Businesses Need Dedicated Customer Service & Helpdesk Software in 2026

    Rising order volumes, real-time delivery expectations, and shoppers who move fluidly across multiple channels mean support teams need more than email queues and scattered notes. They need customer service support and that connect every interaction, surface context instantly, and turn ticket data into decisions.

    This article explores why the right help desk stack matters, how it shapes the customer experience, and which platforms are helping ecommerce businesses handle customer inquiries at scale without sacrificing quality.

    Key highlights

    • Always-on customer support is now a core revenue driver, not just a post-purchase cost center.
    • Robust help desk software helps support teams handle spikes in customer requests without losing quality.
    • Unified ticketing systems and a strong knowledge base give agents full customer history in seconds.
    • Automation features and AI agents reduce repetitive tasks, allowing support agents to focus on complex issues.
    • The right customer support tools help ecommerce companies balance service quality with efficiency while managing WISMO inquiries at scale.

    Top 10 Customer Support & Helpdesk Tools for eCommerce in 2026: Full Platform Comparison

    The platforms below bring together ticket management, omnichannel communication, customer data, and powerful reporting into a single platform, helping ecommerce businesses streamline support operations and deliver exceptional customer experiences consistently.

     

    Name

    Services & features (short)

    91ÊÓÆµ overview (short)

    Tidio

    Live chat, AI chatbot, unified inbox, light help desk

    Free plan; paid tiers by conversations

    HubSpot

    CRM-based help desk, shared inbox, knowledge base

    Free plan; tiered per-seat subscriptions

    eDesk

    Marketplace-focused desk software, AI, and feedback

    Per-user plans with AI add-ons

    Kapture CX

    Vertical AI Customer Experience Platform

    Module Based (Request Custom 91ÊÓÆµ)

    Zendesk

    Enterprise help desk software, omnichannel, analytics

    Per-agent Suite plans with AI options

    Freshdesk

    Cloud help desk, automation, omnichannel support

    Free plan; multiple per-agent paid tiers

    Help Scout

    Shared inbox, Docs, Beacon chat, AI assistance

    Contact-based pricing with trials

    Re:amaze

    Unified inbox, live chat, and ecommerce integrations

    Per-user and volume-based options

    Richpanel

    Ecommerce help desk, self-service portal, AI sidekick

    Tiered pricing by orders and agent seats

    Zoho Desk

    Context-aware help desk, automation, Zia AI

    Free plan; tiered per-agent bundles

    Salesforce

    Service Cloud desk platform, CRM, AI automation

    Per-user editions from Starter to Unlimited

     

    1. Tidio: Best Live Chat and AI Chatbot Tool for Small Ecommerce Teams in 2026

    Tidio stands out for combining live chat, chatbot automation, and a lightweight help desk in a single, unified inbox built for fast-growing commerce businesses. It is especially popular with small teams that want real-time customer support on their storefronts without a heavy implementation. Merchants running ecommerce shipping software alongside Tidio benefit from having order context and chat in one place.

    Key features

     

    • AI agent Lyro for automated replies to common customer queries

    • Unified inbox for chat, email support, and social messages

    • Prebuilt chatbot flows for order status and FAQs

    • Basic ticketing systems with customer history in one view

    Tidio offers a free plan with limited conversations, then scales through paid tiers based on billable conversations and add-on automation features. It is best suited for small teams and mid-market ecommerce businesses that want to manage customer conversations quickly and affordably. Teams handling frequent where-is-my-order inquiries will find Tidio's chatbot flows especially useful for deflecting repetitive tickets.

    2. HubSpot Service Hub: How to Use a CRM-Based Help Desk for Ecommerce Customer Support

    HubSpot Service Hub brings customer service tools onto the same CRM foundation used for sales and marketing campaigns, making it easier for support teams to see complete customer details in context. For ecommerce companies that already use HubSpot, it feels like a natural extension of their existing systems. It integrates well with post-purchase platforms to give support agents visibility into the entire buyer journey.

    Key features

    • Help desk ticketing with automated workflows and routing

    • Shared inbox for multiple channels, including chat and Facebook Messenger

    • Built-in knowledge base connected to AI agent–powered chatbots

    • Deep customer relationship management and reporting across one platform

    HubSpot provides a generous free plan and several paid tiers that scale by seat count and feature depth. It works well for e-commerce businesses that want integrated support operations, simple contact management, and a single source of truth for managing customer interactions. Support teams that also need to manage ecommerce order tracking updates will appreciate how HubSpot's CRM can surface shipment status alongside ticket history.

    3. eDesk Review: The Best Help Desk Software for Multi-Marketplace Ecommerce Sellers

    Built specifically for multi-marketplace sellers, eDesk is a specialized desk solution that pulls order and shipping data from marketplaces and ecommerce platforms directly into the help desk. It is designed to reduce the back-and-forth when customers ask, "Where is my order?" — one of the most common ecommerce support challenges teams face daily.

    Key features

    • Unified inbox tied to orders from Amazon, eBay, Shopify, and other platforms

    • AI agent–driven suggestions and automated responses for repetitive tasks

    • Ticket management enriched with shipping, tracking, and refund data

    • Feedback and review tools to request and track customer feedback

    91ÊÓÆµ is seat-based with different plans depending on volume and advanced AI usage. eDesk is ideal for ecommerce businesses selling across multiple platforms that need customer support software built around marketplace SLAs and order-linked support tickets. Businesses that also rely on a multi-carrier shipping setup will find eDesk's order-enriched tickets especially valuable for resolving shipping delay complaints faster.

    4. Kapture CX: Best Helpdesk Software

    Kapture CX is a built for enterprise ecommerce support teams. It handles order queries, return requests, and delivery complaints through AI agents trained on real ecommerce interaction data. Every incoming query gets classified automatically. Agents get real time next best action suggestions. Negative sentiment gets flagged before it escalates.

    Key features

    • Unified inbox for voice, email, chat, WhatsApp, Instagram, and SMS
    • AI agents that resolve order tracking and return queries without human involvement
    • Real time sentiment analysis and next best action recommendations
    • Customer 360 view with full order history on every ticket

    Kapture CX uses custom pricing based on team size and feature requirements. It is best suited for enterprise ecommerce businesses handling thousands of support interactions daily across multiple channels and geographies. Teams that need industry specific compliance, multilingual support, and AI that goes beyond basic automation will find Kapture a stronger fit than general purpose tools. Ecommerce businesses reporting high WISMO volumes have used Kapture's AI agents to deflect up to 60% of routine queries, reducing agent workload significantly while improving first contact resolution rates.

    5. Zendesk for Ecommerce: Enterprise Help Desk Features, 91ÊÓÆµ, and Omnichannel Support Reviewed

    Zendesk remains one of the most established help desk platforms, giving support teams robust ticketing systems, strong automation, and mature analytics. It is widely used by larger ecommerce businesses that need to manage customer interactions at scale and across multiple channels. Its flexible integration layer connects easily with order management software and logistics platforms so agents always have accurate fulfillment context.

    Key features

    • Omnichannel help desk with email, chat, phone support, and social messaging

    • AI agent, macros, and automated workflows for faster resolutions

    • Self-service help center and knowledge base tools

    • Agent workspace with rich customer context from integrated support apps

    Zendesk pricing is per agent and organized into bundled Suite plans with optional AI add-ons. It is best suited for ecommerce support teams that want advanced desk features, detailed agent performance reporting, and room to scale globally. Teams managing high volumes of ecommerce returns will particularly value Zendesk's automated routing and SLA management for keeping return-related tickets on track.

    6. Freshdesk for Ecommerce: Affordable Cloud Help Desk Software with Powerful Automation in 2026

    Freshdesk offers cloud-based help desk software that gives support teams a clean interface, powerful automations, and flexible pricing for both small and large commerce businesses. It works well for teams that want modern customer service software without a long learning curve. Freshdesk pairs naturally with branded order tracking pages to reduce inbound ticket volume by keeping customers proactively informed about their shipments.

    Key features

    • Omnichannel desk platform for email support, chat, phone, and socials

    • Automation features for ticket routing, SLAs, and follow-ups

    • Integrated knowledge base and community forums

    • Optional AI agent (Freddy) for bots, suggestions, and summaries

    Freshdesk provides a free plan for very small teams and several paid tiers priced per agent. It is a strong fit for ecommerce businesses that want to automate repetitive tasks, organize support inquiries, and maintain a human, personalized support experience. Businesses that receive high volumes of ecommerce fraud-related disputes or return requests will find Freshdesk's automation rules effective at triaging and prioritizing those tickets.

    7. Help Scout Review: Human-First Shared Inbox and Help Desk for Ecommerce Brands

    Help Scout positions itself as a help desk built with a customer-centric approach, focused on conversational support rather than traditional ticket numbers. It is popular with brands that want their customer conversations to feel like email threads rather than case IDs. Its simplicity makes it a good complement for growing direct-to-consumer brands that want to scale support without making customers feel like numbers.

    Key features

    • Shared inbox that lets teams manage customer conversations collaboratively

    • Docs' knowledge base with simple authoring tools

    • Beacon live chat widget with smart self-service features

    • Built-in AI tools for drafting, summarizing, and rewriting replies

    Help Scout's pricing is based on the number of contacts helped per month, and every plan includes a free trial period. It is well-suited to commerce businesses and SaaS brands that value service quality, agent experience, and a more human feel to their desk software. For teams that also invest in a strong post-purchase experience, Help Scout's Docs knowledge base is a quick way to deflect common delivery and returns questions.

    8. Re:amaze for Shopify and BigCommerce: Unified Inbox and Live Chat Help Desk Reviewed

    Re:amaze is an e-commerce-focused help desk platform that merges live chat, email, social messaging, and proactive support into one unified inbox. It is widely used by Shopify and BigCommerce merchants who need tight store integration and flexible engagement tools. Re:amaze connects natively with Shopify order tracking data so agents can pull up shipment status without switching tabs.

    Key features

    • Unified inbox for website chat, email, SMS, and social channels

    • Proactive support via in-app messages and on-site prompts

    • E-commerce integrations that surface customer data and order details

    • Automation features for workflows, macros, and chatbots

    Re:amaze offers both per-user and conversation-based pricing options, with no-cost trials available. It is a good fit for e-commerce businesses that rely heavily on live chat to handle customer queries while customers browse product pages or checkout. Merchants using WhatsApp for ecommerce notifications will appreciate Re:amaze's ability to unify that channel alongside chat and email in a single support queue.

    9. Richpanel Review: Ecommerce Help Desk with Self-Service Returns Portal and AI Sidekick

    Richpanel focuses on ecommerce support by combining a help desk with a powerful self-service returns portal that mimics the experience on large marketplaces. It is designed to help customers find answers and complete purchases or returns without having to talk to an agent. For merchants looking to reduce the operational burden of returns, Richpanel works well alongside dedicated returns management software to create a seamless post-purchase flow.

    Key features

    • Multichannel support workspace for email, chat, SMS, and social

    • Self-service account and self-service returns portal for order changes

    • AI agent sidekick to draft replies and moderate social comments

    • Strong ecommerce integrations that keep customer history and order events visible

    Richpanel offers tiered plans based on order volume, agent seats, and specific desk features. It works best for ecommerce businesses that want to reduce support tickets by helping customers find answers and manage their own orders in a branded portal. Brands that experience high ecommerce return rates will find Richpanel's self-service portal particularly effective at deflecting routine return and exchange requests before they reach the support queue.

    10. Zoho Desk for Ecommerce: Context-Aware Help Desk with Zia AI, Automation, and Affordable 91ÊÓÆµ

    Zoho Desk is a context-aware help desk solution that integrates deeply with the Zoho ecosystem while remaining flexible enough to stand alone. It provides support teams with powerful automation, a configurable knowledge base, and detailed analytics at a relatively affordable price. For ecommerce businesses running on supply chain management software, Zoho Desk's open API makes it straightforward to pipe order and logistics data into the agent workspace.

    Key features

    • Omnichannel desk platform for email, chat, social, and telephony

    • Zia AI agent for suggestions, sentiment, and automation

    • Extensive knowledge base and community forum options

    • Blueprint and automated workflows for complex customer support workflows

    Zoho Desk offers a free plan for very small teams, plus several paid tiers per agent. It is an attractive option for ecommerce companies seeking integrated support operations, contact management, and robust help desk solutions without enterprise pricing. Teams that handle a mix of inbound support and outbound delivery tracking notifications will find Zoho Desk's automation rules flexible enough to manage both workflows from a single platform.

    11. Salesforce Service Cloud Review: Enterprise Ecommerce Help Desk with CRM and Einstein AI

    Salesforce Service Cloud extends Salesforce CRM into a full help desk platform for large support teams that want deep customer context and sophisticated automation at scale, while for teams getting started. Salesforce has become one platform for sales, service, and customer success operations. For enterprises running complex ecommerce supply chain management operations, Service Cloud's integration capabilities mean customer-facing teams and operations teams can share a single data layer.

    Key features

    • Case management with omnichannel routing and queueing

    • Integrated support console with full customer history and account data

    • Powerful knowledge base and self-service portals

    • Einstein AI agent and automated workflows for routing, replies, and insights

    Service Cloud is licensed per user, with distinct editions ranging from lower-cost suites to Unlimited tiers with advanced AI and analytics. It is most suitable for larger ecommerce businesses that treat customer support tools as part of a broader customer relationship management strategy. Enterprises that manage B2B ecommerce supply chains alongside DTC operations will appreciate Service Cloud's ability to handle both customer types within a single support structure.

    How to Choose the Right Customer Service Help Desk Tool for Your Ecommerce Business in 2026

    Thoughtful investment in customer support & helpdesk tools for ecommerce is now one of the clearest ways to build a competitive edge without simply spending more on ads. For a quick, side-by-side comparison to help select the right solution, see a short list of the tailored for ecommerce teams. The right mix of help desk software, ticketing systems, knowledge base content, and AI-driven automation lets support teams absorb volume, protect service quality, and keep support tickets under control while commerce businesses grow. Pairing your chosen help desk with a robust package and parcel tracking software solution means your agents spend less time chasing courier updates and more time resolving the issues that actually require human judgment.

    In a market where products can be copied quickly, how a support team uses customer support tools, manages customer returns and refund inquiries, and closes the loop on customer feedback is what quietly turns one-time buyers into long-term advocates. The teams that also invest in reducing shipping delays and offering proactive estimated delivery date communications will generate far fewer inbound tickets in the first place — making every helpdesk tool on this list work harder and smarter.

    The Logistics Automation Platform for E-commerce

    Momentum Leader - G2 Users Most Likely To Recommend - G2 Best Results Mid-Market - G2
    . window.disableHubSpotCookieBanner = true; function killNative() { var n = document.getElementById("hs-eu-cookie-confirmation"); if (n && n.parentNode) { n.parentNode.removeChild(n); return true; } return false; } killNative(); if (window.MutationObserver) { var mo = new MutationObserver(function () { killNative(); }); mo.observe(document.documentElement, { childList: true, subtree: true }); setTimeout(function () { mo.disconnect(); }, 15000); } var COOKIE = "cp_cookie_consent"; var EU = ["at","be","bg","hr","cy","cz","dk","ee","fi","fr","de","gr","hu","ie","it","lv","lt","lu","mt","nl","pl","pt","ro","sk","si","es","se","gb","uk","is","li","no","ch"]; function readCookie(nm) { var m = document.cookie.match(new RegExp("(?:^|; )" + nm + "=([^;]*)")); return m ? decodeURIComponent(m[1]) : null; } function writeCookie(nm, val, days) { var d = new Date(); d.setTime(d.getTime() + (days * 864e5)); document.cookie = nm + "=" + encodeURIComponent(val) + ";expires=" + d.toUTCString() + ";path=/;SameSite=Lax" + (location.protocol === "https:" ? ";Secure" : ""); } function stored() { var raw = readCookie(COOKIE); if (!raw) return null; try { var o = JSON.parse(raw); if (typeof o.analytics === "boolean") return o; } catch (e) {} return null; } function apply(state, revoke) { window._hsp = window._hsp || []; window._hsp.push(["setHubSpotConsent", { analytics: !!state.analytics, advertisement: !!state.advertisement, functionality: !!state.functionality }]); if (revoke && !state.analytics && !state.advertisement && !state.functionality) { window._hsp.push(["revokeCookieConsent"]); } window.dataLayer = window.dataLayer || []; window.dataLayer.push({ event: "cp_cookie_consent", cp_consent_analytics: !!state.analytics, cp_consent_advertisement: !!state.advertisement, cp_consent_functionality: !!state.functionality }); document.documentElement.setAttribute("data-cp-consent", "set"); } function inScope(banner) { if (banner.getAttribute("data-scope") !== "eu_only") return true; var geo = (document.body.getAttribute("data-geo_location") || "").toLowerCase(); if (!geo) return true; return EU.indexOf(geo) !== -1; } function init(banner) { var days = parseInt(banner.getAttribute("data-days"), 10) || 180; var prefs = banner.querySelector("[data-cpcb-prefs]"); var compact = banner.querySelector('[data-cpcb-actions="compact"]'); var expanded = banner.querySelector('[data-cpcb-actions="expanded"]'); var toggles = banner.querySelectorAll("[data-cpcb-toggle]"); function show() { banner.hidden = false; requestAnimationFrame(function () { banner.classList.add("is-visible"); }); } function hide() { banner.classList.remove("is-visible"); setTimeout(function () { banner.hidden = true; }, 300); } function collapse() { if (!prefs) return; prefs.hidden = true; if (expanded) expanded.hidden = true; if (compact) compact.hidden = false; } function expand() { if (!prefs) return; prefs.hidden = false; if (compact) compact.hidden = true; if (expanded) expanded.hidden = false; } function paint(state) { Array.prototype.forEach.call(toggles, function (t) { var key = t.getAttribute("data-cpcb-toggle"); if (key === "necessary") { t.setAttribute("aria-checked", "true"); return; } t.setAttribute("aria-checked", state[key] ? "true" : "false"); }); } function fromToggles() { var state = { analytics: false, advertisement: false, functionality: false }; Array.prototype.forEach.call(toggles, function (t) { var key = t.getAttribute("data-cpcb-toggle"); if (key in state) state[key] = t.getAttribute("aria-checked") === "true"; }); return state; } function commit(state, revoke) { writeCookie(COOKIE, JSON.stringify({ analytics: !!state.analytics, advertisement: !!state.advertisement, functionality: !!state.functionality, v: 1, ts: Date.now() }), days); apply(state, revoke); hide(); } Array.prototype.forEach.call(toggles, function (t) { if (t.disabled) return; t.addEventListener("click", function () { t.setAttribute("aria-checked", t.getAttribute("aria-checked") === "true" ? "false" : "true"); }); }); banner.addEventListener("click", function (e) { if (!e.target || !e.target.closest) return; var btn = e.target.closest("[data-cpcb-action]"); if (!btn) return; var action = btn.getAttribute("data-cpcb-action"); if (action === "customise") { expand(); return; } if (action === "accept") { commit({ analytics: true, advertisement: true, functionality: true }, false); return; } if (action === "reject") { commit({ analytics: false, advertisement: false, functionality: false }, true); return; } if (action === "save") { commit(fromToggles(), true); return; } }); var existing = stored(); if (existing) { apply(existing, false); paint(existing); collapse(); } else if (!inScope(banner)) { // Out of the consent-required region: implied consent, banner never shown. commitSilently(); } else { collapse(); show(); } function commitSilently() { var all = { analytics: true, advertisement: true, functionality: true }; writeCookie(COOKIE, JSON.stringify({ analytics: true, advertisement: true, functionality: true, v: 1, ts: Date.now(), implied: true }), days); apply(all, false); } // Public re-open hook for a footer "Cookie settings" link. window.cpCookieBanner = window.cpCookieBanner || {}; window.cpCookieBanner.open = function () { var s = stored() || { analytics: false, advertisement: false, functionality: false }; paint(s); expand(); show(); }; } function boot() { var banners = document.querySelectorAll("[data-cpcb]"); if (!banners.length) return; init(banners[0]); document.addEventListener("click", function (e) { if (!e.target || !e.target.closest) return; var trigger = e.target.closest("[data-cp-cookie-settings]"); if (!trigger) return; e.preventDefault(); if (window.cpCookieBanner && window.cpCookieBanner.open) window.cpCookieBanner.open(); }); } if (document.readyState === "loading") { document.addEventListener("DOMContentLoaded", boot); } else { boot(); } })();