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 >

7 Best eCommerce Shipping Software Tools in USA (2026)

7 Best eCommerce Shipping Software Tools in USA (2026)

Manjusha Pal
By Manjusha Pal
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

    This guide covers 7 US shipping tools I compared, a table with USD pricing, a stage-based pick by order volume, and 2026 criteria like Carrier Integration, returns, and shipping and returns protection.

    Shipping is where US online stores quietly lose both sales and margin. Extra costs at checkout, mostly shipping, are the single biggest reason buyers walk away: , and . With , the right eCommerce shipping software is what lets a brand offer competitive delivery without shipping its profit away.

    Three categories get blurred here, so let me separate them. A carrier (USPS, UPS, FedEx, DHL) moves the package. eCommerce shipping software sits on top of the carriers, pulling orders from your stores, comparing live rates, printing labels, and handling tracking and returns. A 3PL goes further and physically stores, packs, and ships your inventory for you. As Veeqo founder Matt Warren , "shipping orders and managing inventory across channels was time consuming and error prone." The seven tools below fix that in different ways.

    Why Cheap Shipping Software Can Still Cost You Margin

    Picture a store shipping 800 orders a month at retail carrier rates. If rate shopping across carriers saves an average of $1.50 per label, that is $1,200 a month left on the table, more than most software plans cost for a year. Headline plan price is the small number. The one that matters is your total landed cost per order: the label, plus surcharges (fuel, residential, dimensional weight), plus the cost of returns, plus any fee for using your own carrier account.

    How eCommerce Shipping Software Lowers Your Per-Unit Shipping Cost

    eCommerce shipping software lowers your per-unit shipping cost in four ways: rate shopping across carriers to book the cheapest qualifying service per order, pre-negotiated commercial discounts that solo sellers cannot get directly, address verification that prevents costly correction fees and returns, and automation that removes manual label work. Handled together, these levers give a US store a predictable cost per package rather than a bill that jumps with every surcharge and peak-season rate hike.

    Where ClickPost Fits: Shipping Intelligence for US Brands

    A quick note before the rankings, since it is not one of the seven. ClickPost is an eCommerce shipping software available in the US market, but it sits in a different tier from the rate-shopping tools below. Rather than competing on the cheapest USPS label, it works as a shipping intelligence and post-purchase layer for brands operating at scale.

    • Multi-carrier intelligence: AI courier allocation that picks carriers on delivery performance and cost, not rate alone, across a brand's full carrier mix.

    • Exception and returns management: automated tracking, delivery-exception workflows, and branded returns to cut failed deliveries and support tickets.

    • Branded post-purchase: branded tracking pages and proactive notifications that turn the delivery window into a retention channel.

    For a US brand past the point where a label tool is enough, ClickPost is worth evaluating alongside the fulfillment and enterprise options here. The seven picks below are the tools you compare when the job is booking and printing labels at the best rate.

    How I Compared These Tools (Methodology)

    I scored each tool on starting price and pricing model, carrier access and rate discounts, rate-shopping and automation depth, integrations with major US sales channels, returns and address verification, and support. 91ÊÓÆµ reflects public rates as of Q3 2026. Carrier discounts are advertised maximums and vary by service, weight, and zone, so always compare live rates before you commit.

    eCommerce Shipping Software Compared: US Feature Matrix

    Read the price column as a starting point, not a full cost. Free tools still cost you postage, and paid tools bill carrier postage separately from the subscription. Discounts shown are advertised maximums off retail rates.

    Platform Starting Price Model Carriers Rate Discounts Best For
    ShipStation $14.99/mo Software 40+ (USPS, UPS, FedEx, DHL) Up to 90% off Multichannel depth
    Shippo Free / $17/mo Software + API 40+ (USPS, UPS, DHL, ltd FedEx) Up to 90% off USPS Discounts, no monthly min
    Pirate Ship Free Software USPS, UPS Up to 89% off Free for small sellers
    Veeqo Free Software USPS, UPS, FedEx, DHL Commercial + 5% back Amazon multichannel
    EasyPost Free to 3,000 labels API 100+ carriers Up to 88% off Developers, platforms
    ShipBob Custom ($275/mo min) 3PL fulfillment Carrier-managed Network-negotiated Outsourced 2-day fulfillment
    ShippingEasy Tiered (verify) Software + marketing USPS, UPS Up to 80% off Shipping plus marketing

    Note: Prices and discounts are indicative as of Q3 2026 and change with carrier rate updates and vendor plan changes. Verify current pricing on each vendor's page before committing.

    The 7 Best eCommerce Shipping Software Tools for US Sellers (2026)

    ShipStation: Best for Multichannel Sellers Who Want Depth

    Multi-carrier shipping software trusted by over a million businesses, ShipStation pulls orders from every store into one dashboard for rate shopping, automation, labels, and returns. It restructured its plans in July 2025 and remains the most feature-complete option for brands juggling several channels and carriers. You can read its before signing up.

    • 91ÊÓÆµ: three volume-based plans, Starter $14.99/mo (from 50 shipments), Standard $29.99/mo, and Premium $349.99/mo, with up to 20% off on annual billing and a 30-day free trial. No permanent free plan.

    • Carriers: USPS, UPS, FedEx, DHL Express, GlobalPost, OnTrac, and 40+ carriers, or bring your own carrier account.

    • Rate discounts: advertised up to 90% off FedEx, 87% off USPS, and 85% off UPS retail rates.

    • Standout and 2026 update: deep automation rules, branded tracking and returns, plus LTL freight and inventory in one login; carrier-connection fees were removed for accounts created after July 8, 2025.

    • Pros: widest integrations and automation depth; strong multichannel order management.

    • Cons: API access moved to a higher tier in 2025, which frustrated API-dependent users; postage is billed separately and there is no free plan.

    • Best for: established multichannel brands shipping steady volume across several carriers.

    My take: still the default for sellers who have outgrown a free label tool and need real automation across channels.

    Shippo: Best for Discounted Rates Without a Monthly Commitment

    Shippo gives small and mid-size sellers the kind of carrier discounts that usually require enterprise volume, through both a web app and an API. Its free tier is genuinely useful, and you can see its with no volume minimum.

    • 91ÊÓÆµ: free Starter (about 30 labels a month, $0.05 per label when using your own carrier accounts); Pro from $17/mo scaling to $199/mo by volume; Premier custom.

    • Carriers: USPS, UPS, DHL Express, and limited FedEx (Ground Economy and International Connect Plus), across 40+ carriers.

    • Rate discounts: up to 90% off USPS retail and up to about 77% off daily UPS rates.

    • Standout: live rate comparison at label creation, batch labels, returns, shipment insurance, and a developer-friendly API with webhooks.

    • Pros: real carrier discounts with no monthly commitment; equally strong as an app or an API.

    • Cons: FedEx coverage is limited; post-delivery surcharges can add 20% to 30% to the final cost; support quality is inconsistent by account.

    • Best for: scaling DTC brands and platforms that want discounted rates plus optional API access without a fixed monthly fee.

    My take: the one I reach for when a seller wants carrier discounts today and might want an API later, without paying to start.

    Pirate Ship: Best Free Tool for Small Sellers on USPS and UPS

    Pirate Ship is genuinely free label software, funded by its carrier partnerships rather than by merchants. It has with no markup, which makes it the default starting point for small US sellers.

    • 91ÊÓÆµ: $0. No monthly fee, no per-label markup, no minimum volume, and no credit card to sign up. You pay only discounted postage.

    • Carriers: USPS and UPS only.

    • Rate discounts: USPS Commercial 91ÊÓÆµ and UPS Ground discounts, advertised up to 89% off retail, passed through at cost.

    • Standout: a deliberately minimal interface, USPS Connect eCommerce rates, Priority Mail Cubic, and Simple Export Rate for cheap international.

    • Pros: truly free with deep USPS and UPS discounts; nothing is locked behind paid tiers.

    • Cons: only two carriers, no FedEx or DHL; chat and email support only, no phone; light on automation; international ships only from the US.

    • Best for: low to mid-volume sellers who ship USPS and UPS and want the cheapest rates for free.

    My take: if you are under a few hundred orders a month and live on USPS and UPS, start here and do not pay for more until you need it.

    Veeqo: Best Free Option for Amazon-Led Multichannel Sellers

    Owned by Amazon, Veeqo is with light inventory tools, previously priced around $450 a month before Amazon made it free. Its edge is protection you cannot get anywhere else if you sell on Amazon.

    • 91ÊÓÆµ: free shipping features with unlimited users and shipments; you pay only carrier postage and earn up to 5% back in Veeqo Credits. Paid Inventory add-on from $19/mo.

    • Carriers: pre-negotiated USPS, UPS, FedEx, and DHL, plus OnTrac and Amazon Shipping, or connect your own accounts free.

    • Standout: Amazon Buy Shipping integration and account-health protection against A-to-z claims and OTDR penalties, exclusive to Veeqo; rate shopping and batch shipping up to 100 orders.

    • Integrations: Amazon, Shopify, eBay, Etsy, Walmart, and WooCommerce in one dashboard.

    • Pros: free with strong US carrier rates plus Amazon account protection no third-party tool offers.

    • Cons: your shipping tool is now owned by your largest sales channel; inventory automation moved to a paid add-on; EU carrier coverage lags; overkill under 30 orders a month.

    • Best for: Amazon-first sellers running one to three other channels who want free US rates and account protection.

    My take: hard to argue with free plus Amazon account protection, as long as you are comfortable with Amazon owning the tool.

    EasyPost: Best for Developers and Platforms Building Shipping In-House

    EasyPost is a that reaches 100+ carriers through one REST integration, aimed at engineering teams, 3PLs, and platforms that want carrier logic inside their own software rather than a dashboard.

    • 91ÊÓÆµ: Free Access (Wallet Carriers) covers up to 3,000 labels a month (postage separate, then about $0.08 per label); a Bring-Your-Own-Carrier plan is $20/mo plus a per-label fee; Forge, GlobalShip, and Luma are custom.

    • Carriers: 100+, including USPS, UPS, FedEx, DHL, plus regional, same-day, and consolidator services.

    • Standout and AI: Luma, an AI layer for rate shopping and carrier selection trained on historical shipment data; CASS-certified address verification; tracking with branded pages and webhooks; insurance at 1% up to $5,000; 99.99% uptime.

    • Pros: broadest carrier reach through one integration, enterprise reliability, and AI-driven carrier selection.

    • Cons: developer-only, so it needs engineering time; no full operations dashboard on its own; per-label and add-on fees add up at volume.

    • Best for: teams and 3PLs embedding shipping into their own systems rather than working from a UI.

    My take: the right pick only if you have developers; for everyone else, one of the app-based tools above will get you shipping faster.

    ShipBob: Best for Outsourcing Fulfillment and Offering 2-Day Delivery

    ShipBob is a tech-enabled 3PL that from a distributed center network, so you can promise 2-day delivery without running a warehouse. It is a different category from the label tools, but it is where many brands land once fulfillment becomes the bottleneck.

    • 91ÊÓÆµ: custom quotes only, with roughly a $275 monthly fulfillment minimum; the real bill mixes storage, receiving, pick, and shipping fees. No public entry price or free trial.

    • Network: 50+ fulfillment centers across the US, Canada, UK, EU, and Australia; distributing inventory across two or three centers can cut average shipping cost by 15% to 25%.

    • Standout and 2026 update: the Spring 2026 ShipBob Delivery Promise shows estimated delivery dates from real network data before checkout; plus branded unboxing, B2B and EDI, kitting, and a WMS option.

    • Integrations: Shopify (Plus certified), Amazon, Walmart, BigCommerce, WooCommerce, and more.

    • Pros: strong distributed network and broad 2-day reach; offloads warehousing and packing entirely.

    • Cons: quote-only pricing with billing complaints; the $275 minimum hurts low volume; not built for oversized or fragile goods.

    • Best for: established Shopify and DTC brands, roughly 500+ orders a month, that want to outsource fulfillment.

    My take: worth it once fulfillment is core operations rather than a weekend task; skip it if you just need labels and rates.

    ShippingEasy: Best for Small Brands That Want Shipping Plus Marketing

    An Auctane product, ShippingEasy pairs label automation with built-in email and SMS marketing, so post-purchase outreach lives in the same tool as your shipping. It leans on the same for low rates.

    • 91ÊÓÆµ: tiered plans that scale with shipment volume, with a low-volume entry tier; confirm current pricing, since Auctane adjusts its plans.

    • Carriers: USPS and UPS focus, with savings advertised up to 80%.

    • Standout: shipping automation rules combined with integrated customer marketing (email, SMS, reviews), which is rare at this price point.

    • Integrations: Shopify, Amazon, eBay, Walmart, and other major US channels.

    • Pros: shipping and customer marketing in one place; strong USPS rates through Auctane.

    • Cons: shares a parent with ShipStation and overlaps it; carrier range is narrower (USPS and UPS centric); Auctane keeps consolidating brands, so confirm the roadmap.

    • Best for: small and mid-size sellers who want shipping and customer marketing handled by one tool.

    My take: a smart pick if the marketing integration genuinely saves you a separate tool; otherwise ShipStation or Shippo cover the shipping side alone.

    2026 Features Worth Checking Before You Choose

    Rate Shopping and Carrier Diversification

    With USPS, UPS, and FedEx all raising rates in 2026 and moving in different directions by weight and zone, no single carrier stays cheapest all year. Any tool you pick should compare live rates across carriers at label creation, so the cheapest qualifying service wins on every order rather than a default carrier set once and forgotten.

    Returns Management

    US online returns run high, and a clunky returns flow costs you both the refund and the repeat customer. Look for self-serve branded return portals, automated return labels, and exchange options, since keeping the sale as an exchange beats refunding it. Shippo, ShipStation, and ShipBob all handle returns; free tools are thinner here.

    Shipping Protection and Insurance

    Coverage for loss, damage, or theft in transit is usually a paid add-on rather than a core feature. Most tools offer per-shipment insurance at roughly 1% of declared value; EasyPost covers up to $5,000 per package. Decide whether you self-insure low-value orders and buy coverage only above a threshold.

    Switching Shipping Software: A Low-Risk Migration Plan (5 Steps)

    1. Export your shipping history first. Pull 90 days of orders, rates paid, and return data before you leave, so you have a baseline to measure the new tool against.

    2. Confirm carrier accounts and discounts carry over. Check whether you keep the tool's negotiated rates or bring your own carrier accounts, and whether that triggers a per-label fee.

    3. Run a two-week parallel pilot. Route a small share of orders, say 10% to 15%, through the new tool for two weeks, and keep the old one running until the numbers hold up.

    4. Rebuild automations and integrations in order. Connect your storefront first, then automation rules, then any custom API work, which carries the most risk and needs the most lead time.

    5. Test returns and address verification before go-live. These are the flows most likely to break in a migration, so validate them with real orders in a staging window first.

    Frequently Asked Questions About eCommerce Shipping Software in the US

    What is the best eCommerce shipping software in the US?

    For most multichannel sellers, ShipStation offers the best balance of carriers, automation, and integrations. Small sellers on USPS and UPS do well with free Pirate Ship, Amazon-led sellers with free Veeqo, and brands outsourcing fulfillment with ShipBob. The right pick depends on order volume and whether you ship in-house.

    What is the cheapest way to ship for a small ecommerce business?

    Use free software that passes through commercial carrier rates. Pirate Ship gives discounted USPS and UPS labels with no fee, and Shippo's free tier adds multi-carrier rate shopping. USPS Ground Advantage is usually cheapest under one pound, while UPS Ground Saver often wins at heavier weights, so compare per order.

    How does shipping software lower your cost per package?

    They reduce per-unit cost through rate shopping across carriers, pre-negotiated commercial discounts of up to 90% off retail, address verification that prevents correction fees and returns, and automation that cuts manual work. At volume, comparing carriers on every order saves more than locking into one default carrier.

    What does rate shopping mean for US shippers?

    With rate shopping, the software checks each carrier's live price for a shipment and picks the cheapest service that still hits the delivery date. Tools like ShipStation, Shippo, and Veeqo automate it, and AI options like EasyPost's Luma go further by weighing predicted cost and delivery performance, not the sticker rate alone.

    Is it worth switching shipping software for better carrier rates?

    Switch when the numbers justify it: a real drop in total landed cost from better rates, lower returns, or fewer surcharges, set against a one-time migration effort. Because most tools offer similar USPS discounts, the real differences are FedEx and UPS access, automation, and fees for using your own carrier account.

    Do eCommerce shipping tools integrate with Shopify, Amazon, and marketplaces?

    Yes. Most US shipping software connects to Shopify, Amazon, Walmart, eBay, Etsy, WooCommerce, and BigCommerce, pulling orders into one dashboard for rate shopping, labels, and tracking. ShipStation and Shippo have the widest integration lists, and Veeqo is built around Amazon and other channels specifically.

    How does order volume change which shipping tool I need?

    Match the tool to monthly volume. Under 500 orders, use free options like Pirate Ship or Veeqo. From 500 to 5,000, ShipStation or Shippo Pro add automation, and ShipBob becomes an option for outsourced fulfillment. Above 5,000, prioritize API access, reliability, and AI carrier selection.

    Does US shipping software cover lost or damaged packages?

    Coverage for loss, damage, or theft in transit, including porch piracy, is normally a paid add-on rather than a built-in feature. Most US tools sell per-shipment insurance at roughly 1% of declared value, and EasyPost covers up to $5,000 per package. Many sellers self-insure cheap orders and buy protection only above a set value.

    What is the best free eCommerce shipping software?

    Pirate Ship is the best fully free tool for USPS and UPS with no fees or minimums, and Veeqo is the best free option for Amazon-led multichannel sellers, adding account-health protection. Shippo also has a free tier with multi-carrier rate shopping and a small per-label fee for your own carrier accounts.

    Should I use shipping software or outsource to a 3PL?

    Use shipping software when you still pack orders yourself and mainly need cheaper labels and automation. Move to a 3PL like ShipBob when fulfillment volume, 2-day delivery promises, or distributed inventory outgrow your own warehouse. Many brands run shipping software first, then add a 3PL as they scale.

    Conclusion

    The best eCommerce shipping software for your US store depends on where you are. Small sellers should start free with Pirate Ship or Veeqo, scaling brands get real value from ShipStation or Shippo, developers should look at EasyPost, and brands outgrowing their own warehouse should weigh ShipBob. Compare on total landed cost rather than sticker price, shortlist two tools, and run a two-week parallel test before you move your full order volume. 

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