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 >

UPS Ground Shipping for E-Commerce: Rates, Zones, Changes in 2026

UPS Ground Shipping for E-Commerce: Rates, Zones, Changes in 2026

Teerna Mandal
By Teerna Mandal
Sathish Loganathan
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. Sathish Loganathan

Ready to delight customers after checkout?

Trusted by 600+ brands

In this blog

    TL;DR Summary

    UPS Ground is UPS's standard domestic ground service, reaching all 50 states and Puerto Rico in roughly 1 to 5 business days across Zones 2 to 8, capped at 150 lbs and 165 inches of length plus girth. The 2026 general rate increase of 5.9% took effect on 22 December 2025 for Ground, not in January. The number that matters is the stack: on UPS's published 2026 card a 10 lb parcel to Zone 5 has a base rate of $13.74, and once you add the $6.50 residential charge and a ground fuel surcharge in the mid-20s, the invoice lands near $25.55, roughly 86% above base. UPS Ground Saver, rebranded from SurePost on 2 April 2025, spent most of 2025 fully inside the UPS network; USPS returned to last-mile delivery for part of that volume in January 2026. For teams above 1,000 shipments a month, zone distribution, dimensional packaging and surcharge caps are the three levers that move the number.

    Introduction 

    Shipping is the largest variable line on most direct-to-consumer P&Ls, and ground volume is where the bulk of it sits. Yet almost every guide written about it is aimed at someone posting a single parcel, not at the operations manager who has to explain a 9% variance to finance.

    UPS Ground is UPS's standard domestic ground shipping service, delivering packages to all 50 states and Puerto Rico in roughly 1 to 5 business days on a zone-based pricing model. It carries packages up to 150 lbs and handles the majority of ground volume for most e-commerce operations.

    This piece does four things the ranking results do not. It prices from rather than rounded estimates. It shows the full surcharge stack in dollars, at several weights and zones. It covers what actually happened to UPS Ground Saver across 2025 and 2026, which is more complicated than the rebrand headline suggests. And it gives you contract negotiation guidance, which is absent from every top-ranking page on this topic.

    What Is UPS Ground? Service Scope, Coverage, and Key Specifications

    Coverage and Eligibility

    UPS Ground is a day-definite domestic ground service covering the 48 contiguous states, Alaska, Hawaii and Puerto Rico. 91ÊÓÆµ runs on a zone and weight matrix, with zones numbered 2 through 8 for the contiguous states. There is no Zone 1 in the published UPS Ground structure, so short local moves start at Zone 2. Per , packages may weigh up to 150 lbs, measure up to 108 inches in length, and reach 165 inches in length plus girth combined.

    What UPS Ground Is Not

    It carries nothing internationally, and nothing above 150 lbs, which moves to UPS Ground with Freight 91ÊÓÆµ on a different rate structure. It is also distinct from UPS Ground Saver, the economy residential tier covered below, and from the air services where the residential surcharge is $7.00 rather than $6.50. Hazardous materials are accepted only within approved categories.

    How UPS Ground Works: The Hub-and-Spoke Network

    Package Journey from Pickup to Delivery

    A parcel is labelled, collected or dropped off, and inducted into a regional hub. It then moves by overnight linehaul between hub nodes, arrives at the destination hub, sorts to a local delivery unit, and goes out on a route. Transit time is a function of how many hub transfers sit in between, which is why an adjacent-state parcel clears in a day or two and a coast-to-coast one takes four or five.

    Business Versus Residential Routing

    Standard UPS Ground delivers direct to the door on both address types, but residential stops cost more to serve, which is what the $6.50 surcharge pays for. Ground Saver volume follows a different path, and since January 2026 part of it hands off to USPS for the final mile. UPS has been reshaping the network underneath all of this: on its Q2 2026 call it reported closing nearly 150 buildings and running 68.5% of volume through automated facilities.

    UPS Ground Transit Times by Zone

    Typical UPS Ground transit by zone

    Zone Typical transit What it usually means
    Zone 2 1 business day Same or adjacent metro, usually a single hub transfer
    Zone 3 2 business days Neighbouring states
    Zone 4 2 to 3 business days Regional, roughly 300 to 600 miles
    Zone 5 3 business days Multi-region, two hub transfers typical
    Zone 6 3 to 4 business days Long haul, often crossing a linehaul boundary
    Zone 7 4 to 5 business days Near coast-to-coast
    Zone 8 5 business days Coast to coast, three or more transfers

    Directional. UPS publishes commitments by origin and destination ZIP pair rather than by zone, so confirm each lane with the UPS Calculate Time and Cost tool before you publish a delivery promise at checkout.

    Saturday Delivery

    UPS Ground runs Monday to Friday by default, with Saturday Ground delivery available in designated service territories rather than nationwide, and Saturday pickup carrying its own charge. Confirm availability and any fee for your origin with your account representative, because coverage is territory-specific.

    UPS Ground 91ÊÓÆµ in 2026: The Full Cost Stack Most Guides Ignore

    Base Rate Structure: Zone, Weight, and Dimensional Weight

    Base rates come off a zone and weight matrix. UPS bills the greater of actual weight and dimensional weight, where dimensional weight is length times width times height in inches divided by 139 on daily rates. Retail counter rates use a 166 divisor. On the published 2026 card, a 10 lb parcel is $11.87 in Zone 2, $13.74 in Zone 5 and $17.00 in Zone 8.

    The 2026 GRI and What It Does to Your Discount

    UPS applied a 5.9% average general rate increase for 2026, and 6 January 2026 for air services. Lighter weight tiers on Ground Residential took increases above the 5.9% average.

    Here is the part nobody publishes. A merchant holding a 30% discount negotiated in 2023 has since absorbed three consecutive 5.9% increases. Compounded, that is a 18.8% rise in the published base their discount is calculated against. The percentage on the contract has not moved, but the dollars behind it have, and the effective saving has quietly shrunk every January.

    Surcharge Stacking: The All-In Cost in Dollars

    Fuel is the multiplier that makes this section necessary. UPS resets its ground fuel surcharge weekly against the national diesel index and applies it to transportation charges plus certain accessorials, so it is charged on the residential fee too. UPS raised the ground index by a further 1% on 5 January 2026 and again in March. For scale, , and UPS has sat at or above FedEx on ground since March. The table below models 26.25%.

    All-in UPS Ground cost, residential delivery, 2026 published rates

    Package Base rate Residential Fuel at 26.25% All-in Above base
    1 lb, Zone 5 $11.01 $6.50 $4.60 $22.11 101%
    5 lb, Zone 5 $11.82 $6.50 $4.81 $23.13 96%
    10 lb, Zone 5 $13.74 $6.50 $5.31 $25.55 86%
    20 lb, Zone 5 $17.56 $6.50 $6.32 $30.38 73%
    50 lb, Zone 5 $29.07 $6.50 $9.34 $44.91 54%
    10 lb, Zone 2 $11.87 $6.50 $4.82 $23.19 95%
    10 lb, Zone 8 $17.00 $6.50 $6.17 $29.67 75%

    Base rates from the published 2026 UPS Small Business Rates card. Fuel modelled at 26.25% applied to base plus residential, which is how UPS assesses it. Delivery Area Surcharges excluded. Fuel resets weekly, so treat this as a point-in-time model rather than a quote.

    Two readings matter. The all-in cost runs 54% to 101% above the base rate you looked up, and the multiple is worst on light parcels because the flat $6.50 residential fee is a bigger share of a small number. Strip the residential charge out and the same 10 lb Zone 5 parcel costs $17.35 commercial against $25.55 residential. That $8.20 gap is the single largest structural cost difference in a DTC ground programme.

    The August 2025 Dimensional Rounding Change

    Since 18 August 2025, UPS rounds every fractional inch up to the next whole inch before calculating dimensional weight. A box measured at 11.2 by 8.4 by 6.1 inches now bills as 12 by 9 by 7. That is 574 cubic inches becoming 756, and dimensional weight moving from 5 lbs to 6 lbs. The effect compounds with anything measured slightly over, and it pushes borderline parcels across surcharge thresholds as well as rate breaks.

    UPS Ground Package Size and Weight Limits

    Three ceilings apply: 150 lbs maximum weight, 108 inches maximum length, and 165 inches length plus girth combined, where girth is twice the width plus twice the height. Exceed any of them and the parcel attracts an Over Maximum Limits charge, which UPS has set at $1,875 per package for 2026. Anything genuinely above 150 lbs belongs on UPS Ground with Freight 91ÊÓÆµ.

    The threshold that catches ecommerce teams sits well below those ceilings. when length plus girth passes 130 inches, or length passes 96 inches, or, from 26 January 2026, cubic volume passes 17,280 cubic inches or actual weight passes 110 lbs. A Large Package bills at a minimum of 90 lbs regardless of what it weighs. Additional Handling picks up parcels above 10,368 cubic inches from the same date, though it is not assessed when the Large Package Surcharge already applies.

    Cost cliff worth knowing: Additional Handling runs roughly $30 to $50 per package. The Large Package Surcharge runs into the hundreds. Crossing from one to the other on a 30 by 24 by 24 inch box, which hits exactly 17,280 cubic inches, is a step change rather than an increment.

    UPS Ground Saver: The Lower-Cost Residential Option

    What Actually Happened, 2025 to 2026

    The usual one-line summary of this service is wrong, so here is the sequence. Effective 1 January 2025, UPS after USPS overhauled its workshare arrangements. On , keeping the entire journey inside its own network, dropping PO Box delivery and Alaska, Hawaii and Puerto Rico coverage, and raising rates by close to 10% on average.

    Then it reversed. Talks restarted after a change of leadership at USPS, and in October 2025 chief executive Carol Tomé told analysts the two sides had a preliminary agreement, saying UPS was confident service levels . The deal was , with USPS resuming last-mile delivery for a portion of Ground Saver and Mail Innovations volume and ramping through the year. So a package may now be delivered by either carrier depending on destination.

    When to Use Ground Saver

    Use it when the parcel is under 10 lbs, the address is residential in the lower 48, and roughly one extra business day against standard Ground is acceptable. Note two operational constraints most guides omit: Ground Saver is a contract service rather than something you can buy at a counter, and from 2 August 2026 UPS applies a $5.00 per package non-compliant label fee if your labelling or shipping system is not current.

    UPS Ground vs FedEx Ground vs USPS Ground Advantage vs UPS Ground Saver

    The four domestic ground options compared, 2026

    Feature UPS Ground FedEx Ground USPS Ground Advantage UPS Ground Saver
    Weight limit 150 lbs 150 lbs 70 lbs Under 10 lbs in practice
    Size limit 165 in L+G 165 in L+G 130 in L+G Tighter than Ground
    10 lb Zone 5 base $13.74 published Near parity with UPS Commercial well below both Below UPS Ground
    Residential surcharge $6.50 $6.95 None Built into the rate
    Fuel surcharge Weekly index, mid-20s 26.25% week of 3 Aug 2026 None as a line item Same index as Ground
    Dimensional weight Divisor 139 Divisor 139 Only above 1 cubic foot Divisor 139
    Transit 1 to 5 business days 1 to 5 business days 2 to 5 business days Ground plus about 1 day
    Declared value included Up to $100 Up to $100 $100 insurance included Reduced versus Ground
    Best for Heavier commercial, transit consistency Similar profile, compare surcharges Light residential under 10 lbs Non-urgent light residential
    2026 change to watch Large Package triggers, 26 Jan Cubic triggers, 12 Jan 8% surcharge to 17 Jan 2027 USPS last mile returned
     UPS base rates from the published 2026 card. USPS figures reflect the 12 July 2026 restructuring. Verified 5 August 2026.

    has a structural advantage on light residential parcels that has nothing to do with negotiation: it charges no residential surcharge and no fuel line, so its published price is close to its invoiced price. UPS Ground earns its keep above roughly 10 to 15 lbs and on commercial addresses, where the hub-and-spoke network delivers more consistent transit and the surcharge stack is thinner. Most operations end up splitting volume rather than standardising.

    Zone Distribution Strategy: The Cost Lever Most Teams Are Missing

    How to Audit Your Zone Profile

    Average shipping zone belongs on your operations dashboard next to cost per order. Calculate it by pulling 90 days of UPS Ground shipments, recording the zone on each, and taking the volume-weighted mean. A single-warehouse brand shipping nationally from either coast typically lands around Zone 5 to 6. Adding a Central US node commonly pulls that to Zone 4 to 4.5.

    What One Zone Is Actually Worth

    Here is where a lot of published advice is too vague to act on, because the answer depends heavily on package weight. On UPS's 2026 card the average cost of one zone step is about 20 cents at 1 lb, 49 cents at 5 lbs, and 86 cents at 10 lbs. Across 5,000 shipments a month, with fuel applied, one zone of average reduction is worth roughly $15,000 a year at a 1 lb average, $37,000 at 5 lbs, and $65,000 at 10 lbs.

    That spread is the whole point. A lightweight apparel brand chasing zone reduction is solving a small problem; a brand shipping 10 to 20 lb parcels is looking at a number that funds the second node on its own. Run your weight profile before you model the warehouse.

    Benchmarks Worth Holding

    If more than 60% of your volume falls in Zones 5 through 8, model a second node. If Zones 2 to 4 already carry the majority, your network is positioned reasonably and your savings live in packaging and surcharges instead.

    UPS Ground Contract Negotiation: What Is Actually Negotiable

    Volume Thresholds

    As a working rule of thumb rather than a published policy, UPS tends to engage on direct negotiation somewhere around 200 to 300 packages a day. Below that, platform-aggregated rates are usually the more practical route. Above roughly 1,000 a day you can push on several line items at once.

    The Line Items to Ask For

    Base rate discounts get the attention and move the least. Ask instead for a cap or waiver on the residential surcharge, a Delivery Area Surcharge cap for the ZIP ranges you actually ship into, a fuel surcharge cap that pegs the index rather than floating with it, and a reduction in the minimum charge floor. On a residential-heavy book, capping the $6.50 residential charge is worth more than several points of base discount.

    Protecting Against GRI Compounding

    The most undervalued clause in a UPS contract is a general rate increase cap. Without one, back-to-back 5.9% increases erode a negotiated discount every January regardless of how well you performed on volume. The context helps you ask: on the second-quarter 2026 call, Tomé said the priority was . A carrier selecting volume rather than chasing it is a carrier that will trade terms for the volume it wants. Bring your shipment profile, not just your total spend.

    Managing UPS Ground with ClickPost

    At low volume, managing UPS Ground by hand is fine. At a few thousand shipments a month, label generation, tracking ingestion, exception detection, customer notification and invoice reconciliation stop fitting into anyone's day, and the cost of missing something rises with the surcharge stack.

    ClickPost handles the UPS integration as one part of a multi-carrier workflow: label generation across carriers, real-time tracking ingestion from UPS APIs, automated exception detection for delays, failed deliveries and address corrections, and branded tracking pages that answer the where-is-my-order question before a customer opens a ticket. Shopify and WooCommerce connect directly, so rules such as sending sub-10-pound residential orders to Ground Saver and everything heavier to standard Ground execute at label creation rather than depending on a packer.

    Reconciliation is the piece that pays for itself here. Residential surcharges applied to commercial addresses, dimensional weight billed above what your packaging data says, and duplicate charges on returns are all correctable, and all invisible unless something is checking.

    Disclosure: ClickPost publishes this blog. Every rate, threshold and effective date above comes from UPS published sources or named reporting, cited so you can verify each independently.

    UPS Ground Operations Checklist

    Packaging

    • Measure each SKU before committing it to a box size, and recalculate dimensional weight under the ceiling-rounding rule

    • Flag any box within an inch of 10,368 or 17,280 cubic inches

    Invoice audit

    • Check residential surcharges against actual address classification

    • Reconcile billed dimensional weight against your own packaging data

    • Check Delivery Area Surcharges against the ZIP ranges you expect

    Zone monitoring

    • Pull an average zone report quarterly and flag if Zones 5 to 8 exceed 60% of volume

    • Model second-node return on investment annually, using your own weight profile

    Contract review

    • Diary a review 90 days before renewal

    • Recalculate your effective discount after each general rate increase, not just at renewal

    Frequently Asked Questions About UPS Ground Shipping

    What is UPS Ground shipping?

    UPS Ground is UPS's standard domestic ground service, covering all 50 states and Puerto Rico in roughly 1 to 5 business days on a zone-based pricing model. It accommodates packages up to 150 lbs with a 165-inch length-plus-girth limit and includes up to $100 of declared value coverage at no extra charge.

    How long does UPS Ground shipping take?

    Transit runs from about 1 business day in Zone 2 to 5 business days in Zone 8, driven by how many hub transfers the parcel passes through. UPS publishes commitments by origin and destination ZIP pair rather than by zone, so confirm each lane before promising a date at checkout.

    How much does UPS Ground shipping cost?

    Cost depends on zone, billed weight and surcharges. On UPS's published 2026 card a 10 lb Zone 5 parcel has a base rate of $13.74. Add the $6.50 residential charge and a ground fuel surcharge in the mid-20s and the all-in figure reaches about $25.55, roughly 86% above base.

    What is the difference between UPS Ground and UPS Ground Saver?

    UPS Ground delivers direct to all address types on standard timing. Ground Saver is the economy residential tier, rebranded from SurePost on 2 April 2025, costing less and typically taking about one extra business day. Since January 2026 USPS handles last-mile delivery on part of that volume again.

    Does UPS Ground deliver on Saturday?

    UPS Ground runs Monday to Friday by default. Saturday Ground delivery is available in designated Saturday service territories rather than everywhere, and Saturday pickup carries a separate charge. Check availability and any fee for your specific origin with your UPS account representative before offering it at checkout.

    What are the size and weight limits for UPS Ground?

    Maximum weight is 150 lbs, maximum length 108 inches, and maximum length plus girth 165 inches. Exceeding any of these triggers an Over Maximum Limits charge of $1,875. The Large Package Surcharge starts far earlier, at 130 inches combined, 96 inches long, 17,280 cubic inches, or 110 lbs.

    How does UPS Ground calculate dimensional weight?

    Multiply length by width by height in inches, then divide by 139 on daily rates. UPS bills whichever is greater, actual or dimensional weight. Since 18 August 2025 every fractional inch rounds up to the next whole inch first, so an 11.2-inch side is calculated as 12 inches.

    What is a UPS shipping zone and how does it affect cost?

    Zones 2 through 8 measure distance between origin and destination in the UPS network, with 2 nearest and 8 furthest. One zone step averages about 20 cents at 1 lb and 86 cents at 10 lbs on the 2026 card, which is why average zone is worth tracking as an operational metric.

    UPS Ground in 2026: What to Do Next

    Three actions carry most of the value. Calculate your current average zone and benchmark it against the 4.0 to 4.5 range a well-positioned network achieves, then price one zone of reduction against your own weight profile rather than a generic figure. Audit your next three UPS Ground invoices for residential surcharge misapplication and dimensional weight discrepancies. And if you clear 500 shipments a month, open a conversation about residential and fuel caps well before the next general rate increase cycle.

    Rate structures and surcharge indexes now move continuously rather than annually, and the fuel percentage behind every figure here resets weekly. Verify current numbers at UPS.com or through a rate comparison before committing them to a checkout or a budget.

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