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ÊÓÆµ

Assess Your Post-Purchase Brand Readiness Start Assessment

Home > Blog >

Buy Now Pay Later (BNPL) in the US: User Growth, Trends & Insights

Buy Now Pay Later (BNPL) in the US: User Growth, Trends & Insights

Teerna Mandal
By Teerna Mandal
Trisala Sahay
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. Trisala Sahay

Ready to delight customers after checkout?

Trusted by 600+ brands

In this blog

    TL;DR Summary

    Buy Now Pay Later reached 91.5 million US users in 2026, establishing BNPL as a mainstream payment method across American retail demographics.

    • BNPL drove $20 billion in US holiday 2025 spending, up 9.8% YoY, outpacing overall online holiday sales growth of 6.8%.

    • Cyber Monday 2025 generated $1.03 billion in single-day BNPL transactions, the first day ever to cross that threshold.

    • 63% of US BNPL users carry multiple concurrent loans, leading to obscured affordability signals and elevated late-payment rates of 34–41%.

    • FICO now incorporates BNPL activity into credit scoring because Affirm began bureau reporting in 2025, ending credit invisibility for the sector.

    • Mobile devices accounted for 82.2% of holiday 2025 BNPL purchases, reshaping checkout UX and fraud modeling requirements for merchants.

    Introduction

    Buy now pay later (BNPL) has moved from a checkout add-on to a mainstream payment method that now shapes conversion, average order value, and customer lifetime value across US retail.

    In 2026, the number of buy now pay later US users crossed 91 million, reflecting shifting consumer preferences for smaller payments, transparent terms, and flexible cash flow. BNPL user data continues to climb, especially during peak shopping periods, where mobile-driven BNPL now sets single-day records.

    For businesses, understanding who is using pay later, how often, and under what conditions is no longer optional. It is central to pricing, risk controls, and merchandising. This article distils the latest 2026 data on BNPL users, adoption drivers, and usage patterns, then translates the trends into practical implications for product, finance, and growth teams.

    BNPL services: Highlights at a glance

    • used buy now pay later in 2026, up from 86.5 million in 2024. Broader adoption surveys put the number of Americans who have ever used BNPL at , which suggests the addressable base is now roughly the entire adult population.

    • Holiday demand remains the single strongest catalyst. BNPL drove up 9.8% year over year, with a new record of (up 4.2% YoY and the first single day ever to cross $1B in BNPL).

    • Multi-lender behavior is widespread: 63% of users report multiple BNPL loans active concurrently, and 33% use more than one lender.

    • Convenience drives stickiness: 48% of users say they will reuse the same provider; 46% cite ease of use as a factor in choosing BNPL.

    • Mobile matters more each year: BNPL purchases happened on smartphones, up from 79% in 2024. That reshapes checkout and risk models.

    • Regulation caught up in 2025-2026. , Affirm began reporting BNPL loans to credit bureaus, and Klarna went public on the NYSE in September 2025 (ticker KLAR). The product is no longer credit-invisible or venture-only.

    The US BNPL user base: Size, trajectory, and what it signals

    The BNPL user base has expanded alongside online shopping and omnichannel retail. With and momentum pointing to roughly 100 to 105 million by 2028, adoption is broadening from early adopters to the mass market.

    The market itself is at a 15.7% CAGR, so per-user spend is climbing faster than user counts. Independent central-bank modelling puts , or about 1.1% of total US credit card volume. This is consistent with a global BNPL market that reached with 380 million users worldwide.

    As BNPL usage scales, payments, credit, and growth teams need to model cohort-level default risk, late-fee exposure, and settlement timing. Marketing should segment by age groups, credit scores, and purchase intent to balance conversion with total cost of acquisition and repayment risk. The 2025-2026 shift to credit-bureau reporting means cohort risk models built on unreported BNPL data are already stale.

    Adoption by age, income, and credit health

    BNPL adoption skews younger but is no longer youth-only. , Gen X sits around 28%, and Baby Boomers around 13%. Millennials still account for the largest share of the total user base by volume, since their generation is larger and further into peak spending years. Gen Z shows the highest adoption rate but also reports the most trouble managing multiple installment schedules.

    Income and credit-health patterns explain who uses BNPL and why. A survey found that 26.6% of users by choice have household incomes between $50k and $100k, while 26.9% who used BNPL out of necessity have incomes below $50k. Nearly 30% of adults with credit scores between 620 and 659 used BNPL, roughly triple the rate of those above 720. This implies that credit checks and responsible-lending messaging are essential, particularly now that .

    Demographically, adoption varies across racial cohorts, with Black Americans showing the highest usage among the groups tracked. Financial stress is a growing overlay. Gen Zers reported living paycheck to paycheck at the start of 2026, and struggle to track store card installment payments. For product teams, this means tailoring installment plans and repayment reminders to segments, while finance teams recalibrate loss allowances as credit health varies.

    Usage patterns: Frequency, providers, and behavioral flags

    BNPL purchases are habitual for many. In late 2024, half of Americans had been offered a BNPL option in the prior 30 days, and roughly 10% made at least one BNPL purchase during that window. Those numbers have only grown since, as more mainstream merchants integrated BNPL at checkout across 2025.

    Multi-lender behavior is the norm. Approximately 63% of users have multiple BNPL loans active at the same time, 33% use more than one BNPL provider, and 48% intend to reuse the same platform.

    This creates both loyalty and risk, because multiple simultaneous loans can obscure affordability signals. Central-bank modelling of CFPB loan data puts , a small share of total consumer debt but growing quickly. Retailers should surface total cost, due dates, and repayment status in-app to reduce missed payments and late fees.

    Spend, seasonality, and channels

    BNPL peaks during gifting cycles and big promos, and 2025 raised the ceiling. Consumers spent . Cyber Monday alone hit year over year and the first single day to cross $1B in BNPL. BNPL growth of 9.8% outpaced overall online holiday sales growth of 6.8%, so BNPL kept taking incremental share of holiday wallet.

    Mobile now dominates pay-later services. BNPL transactions happened on phones, which should influence mobile UX, fraud posture, and messaging. Category mix has broadened too: apparel and electronics remain the leaders, but . Travel, hospitality, utilities, and subscription renewals are the newest growth categories, extending BNPL beyond one-off splurges into routine payment method choices.

    Affordability, fees, and credit hygiene

    BNPL can improve cash flow through interest-free payments when used responsibly, but late payments and missed payments still occur. About 24% of users report overspending with BNPL, and of BNPL users report late payments per CFPB data, even as . The gap between low defaults and high late-payment rates signals that consumers are stretching to meet installment schedules, patterns that can resemble reliance on high-cost options like payday loans.

    The 2025-2026 regulatory shift changes the stakes. FICO now incorporates BNPL loans into its credit scoring model, and Affirm began reporting BNPL loans to credit bureaus in 2025. Klarna and Afterpay have moved more cautiously, but with FICO scoring live, the pressure to report is rising across all providers.

    That means transparency about interest rates (when applicable), consumer fees, and late fees (plus reminders and autopay) now protects consumer credit records too, not just cash flow. Providers and retailers should emphasize total cost, repayment calendars, and what appears (or does not) on the credit record. Clear disclosures protect both shoppers and retail accounts.

    Providers and product design

    Several companies now anchor the US market, ranging from BNPL lenders embedded in merchant checkouts to wallets such as PayPal Pay in 4 and Apple Pay Later. The competitive picture depends on which lens is applied:

    • User preference: A , ahead of Klarna, Affirm, and Afterpay (each cited by 38%). PayPal's advantage is distribution, since it is already embedded in most e-commerce checkouts.
    • Global GMV: Klarna leads with US$3.5bn revenue and US$127.9bn GMV in 2025 across 118 million active consumers and roughly 966,000 merchants. Klarna went public on the NYSE in September 2025 (ticker KLAR). US-specific: , with US payment volume projected at US$30.21bn in 2026.
    • US growth on scale: Affirm posted FY2025 GMV of US$36.7bn and 23 million active accounts, up more than 40% year over year. Its expanded Amazon partnership widens its distribution meaningfully, and Affirm Card users grew from 1.7 million at end of 2024 to 4.4 million by March 2026.
    • Mass-market share: Afterpay, part of Block, generated US$1.04bn revenue in 2024, up 28% YoY, with 2026 US payment volume projected at US$11.26bn. Afterpay is the only major provider that does not automatically run a soft credit check at checkout.

    Differences in settlement timing, chargeback handling, and risk-sharing are material to margin. Some BNPL providers shift portions of default risk back to merchants; others batch settlements in ways that affect cash flow.

    Procurement should compare terms across BNPL companies for repayment windows, late-fee policies, and support SLAs. With FICO scoring live, providers who report to bureaus consistently will attract more credit-conscious shoppers, so reporting practice is becoming a differentiator rather than a nice-to-have.

    Consolidated stats and what they mean

    Below are the headline pay-later statistics operators can use to benchmark BNPL adoption, model risk, and set channel targets.

    Table A: US users and usage snapshot (2026 refresh)

    Indicator Value
    US BNPL users (2026) 91.5 million
    US BNPL adoption rate (2026) 52% of Americans
    Users with multiple concurrent BNPL loans 63%
    Users using more than one BNPL lender 33%
    Users intending to reuse the same provider 48%
    US BNPL market size (2025) US$107.38 billion
    US BNPL market forecast (2031) US$258.40 billion
    Holiday 2025 total BNPL spend US$20 billion (+9.8% YoY)
    Cyber Monday 2025 BNPL spend US$1.03 billion (+4.2% YoY, first single day past $1B)
    Mobile share of holiday 2025 BNPL purchases 82.20%

    Table B: Behavior, risk, and regulatory cues

    Behavior/cue Implication for merchants
    34% to 41% of users report late payments (CFPB) Build proactive reminders and grace-period messaging; late payments now hit credit scores under FICO
    Default rate stays low at 1.8% to 2% Underwriting is working, but late-payment volume signals stretched budgets
    73% of Gen Z living paycheck to paycheck (early 2026) Cash-flow tools and repayment calendars matter more than ever
    56% of Gen Z struggle to track store card installments UX must surface every active BNPL commitment across providers, not just yours
    FICO now scores BNPL activity Responsible-lending messaging becomes a differentiator, and provider-selection criteria should include bureau-reporting practices
    82.2% of holiday BNPL happens on mobile Mobile checkout is the primary conversion surface; friction here costs meaningful revenue
    31% use BNPL for groceries, 29% for delivery food Category expansion means installment fees now touch lower-AOV baskets; unit economics need re-checking

    Conclusion: A practical lens on BNPL's next chapter

    Buy now, pay later is now part of the standard US payment stack. BNPL adoption has broadened, usage has normalized across demographics, and the regulatory infrastructure has finally caught up.

    The headline growth in BNPL market participation (from 86.5 million users in 2024 to 91.5 million in 2026 and toward 100 million by 2028) should prompt merchants to refine credit messaging, optimize mobile journeys, and align with BNPL providers whose settlement terms support working capital and whose bureau-reporting practices support credit-conscious shoppers.

    The opportunity is compelling: more customers, higher conversion, and larger baskets. The obligation is equally clear: mitigate late payments, publish transparent terms, and protect consumers' cash flow now that credit records reflect BNPL activity. Teams that balance payment flexibility with disciplined risk controls will be best placed to win the next wave of pay-later users while safeguarding margin and brand trust.

    Frequently asked questions

    How many people in the US use BNPL in 2026?

    Roughly 91.5 million Americans used buy now pay later in 2026, up from 86.5 million in 2024. Broader adoption surveys put the share of Americans who have ever used BNPL at 52%, meaning the addressable base now covers roughly the entire adult population. Growth momentum points toward 100 to 105 million active users by 2028.

    Which age group uses BNPL the most in the US?

    Gen Z leads BNPL adoption at 59%, closely followed by Millennials at 58%, then Gen X at around 28% and Baby Boomers at around 13%. Millennials still hold the largest share of the total user base by volume, since their generation is larger and further into peak spending years. Gen Z has the highest adoption rate but also reports the most difficulty managing multiple installment schedules.

    How much did Americans spend using BNPL during the 2025 holiday season?

    Americans spent US$20 billion through BNPL during the 2025 holiday season, up 9.8% year over year. Cyber Monday alone hit US$1.03 billion, up 4.2% year over year, and marked the first single day ever to cross US$1 billion in BNPL spend. BNPL growth also outpaced overall online holiday sales growth of 6.8%, meaning BNPL kept taking incremental share of holiday wallet.

    Which BNPL provider do Americans use most?

    A 2025 survey found 56% of BNPL users preferred PayPal Pay in 4, ahead of Klarna, Affirm, and Afterpay (each cited by 38%). PayPal's edge is distribution, since it is already embedded in most e-commerce checkouts. By global GMV, Klarna leads with US$127.9 billion across 118 million active consumers. Affirm posted FY2025 GMV of US$36.7 billion across 23 million active accounts.

    Does BNPL affect your credit score in 2026?

    Yes. FICO now incorporates BNPL loans into its credit scoring model, meaning missed or late payments on BNPL installments can affect credit scores the same way other credit products do. Affirm began reporting BNPL loans to credit bureaus in 2025, and pressure is rising across providers to follow. Klarna and Afterpay have moved more cautiously, but bureau reporting is becoming a differentiator rather than a nice-to-have.

    Why do people use multiple BNPL services at once?

    About 63% of US BNPL users have multiple BNPL loans active at the same time, and 33% use more than one provider. The pattern reflects both convenience and cash flow stretching, since different providers offer different terms, checkout options, and repayment schedules. This creates loyalty for individual providers (48% intend to reuse the same platform) but also obscures affordability signals for lenders and merchants.

    How risky is BNPL for consumers?

    Default rates remain low at 1.8% to 2%, but 34% to 41% of BNPL users report late payments per CFPB data, and about 24% report overspending. The gap between low defaults and high late-payment rates signals consumers are stretching to meet installment schedules. With FICO now scoring BNPL activity, those late payments now hit credit records too, not just monthly cash flow.

    What percentage of BNPL purchases happen on mobile?

    Mobile accounted for 82.2% of BNPL purchases during the 2025 holiday season, up from 79% in 2024. Mobile share keeps climbing each year, which is reshaping how checkout, fraud posture, and repayment reminders need to be designed. Merchants who under-invest in mobile BNPL flows lose conversion at the exact surface where most BNPL demand now lands.

    What can you buy with BNPL in 2026?

    Apparel and electronics remain the leading BNPL categories, but 31% of consumers now use BNPL for groceries and 29% for delivery food. Travel, hospitality, utilities, and subscription renewals are the newest growth categories. The pattern shows BNPL has moved past one-off splurges into routine payment method choices, extending the product into lower-AOV baskets that affect provider and merchant unit economics.

    How big is the US BNPL market in 2025 and beyond?

    The US BNPL market reached US$107.38 billion in 2025 and is projected to grow to US$258.40 billion by 2031, a 15.7% CAGR. That means per-user spend is climbing faster than user counts. Central-bank modelling puts 2025 US BNPL net transaction value at roughly US$70 billion, or about 1.1% of total US credit card volume, so BNPL is still a small share but taking growth quickly.

    Methodology

    The market figures in this report are sourced primarily from established third-party research firms, with first-party sources such as company filings, government data, and regulatory disclosures used to validate and contextualize key figures where available. We prioritize sources that clearly define their methodology, including market scope, geography, time period, and forecast assumptions.

    Where credible sources report different market estimates, we do not average or selectively use figures. Instead, we assess differences in market definitions, coverage, and reporting periods and present the most relevant estimate with appropriate context. We also prioritize recent data and avoid using figures when the original source or methodology cannot be reasonably verified.

    The Post-Purchase Experience Platform

    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(); } })();