Overview
Stripe is the leading payment processing infrastructure provider for online businesses. Stripe.js handles secure card tokenization, renders payment input elements in isolated iframes, manages 3D Secure and Strong Customer Authentication flows, and runs fraud detection heuristics to assess transaction risk — all in the browser on the merchant's checkout page.
What This Script Does
Script Loading
Stripe.js must be loaded from js.stripe.com/v3/ (Stripe's canonical URL) to qualify for PCI-DSS compliance. Loading Stripe from a local copy or any other domain breaks PCI compliance. The script file itself is stripe.js (or stripe.esm.js for ES module imports).
Stripe Elements (Hosted Input Fields)
Stripe Elements renders secure card input fields as iframes hosted on Stripe's domain (js.stripe.com). This means raw card numbers, expiry dates, and CVV codes are entered directly into Stripe-controlled iframes and never touch the merchant's JavaScript execution environment or servers. The merchant's page communicates with the Stripe iframe via postMessage.
Elements rendered:
- Card Number, Expiry, and CVV fields (separate or combined
CardElement) PaymentElement— a smart form that shows the appropriate payment methods for the customer's location (cards, SEPA Direct Debit, iDEAL, BLIK, etc.)AddressElement— address collection with postal validationPaymentRequestButton— Apple Pay and Google Pay button
Payment Processing Flow
- Customer enters card details in the hosted iframe
- Stripe.js calls
stripe.createToken()orstripe.createPaymentMethod()— card data is sent directly to Stripe's servers atapi.stripe.com - Stripe returns a one-time use token or Payment Method ID
- The merchant's JavaScript submits this token/ID to the merchant's server
- The merchant's server charges the card via the Stripe API server-to-server
3D Secure and SCA
For payments requiring 3D Secure authentication, Stripe.js opens an iframe or popup to the card's issuer bank authentication page. The SDK manages the redirect flow and confirmation via stripe.handleCardAction() or stripe.confirmPayment(). Domains involved include hooks.stripe.com and issuer bank authentication URLs.
Fraud Detection Stripe.js collects browser signals to power Stripe Radar fraud detection:
- Browser fingerprint: User-Agent, screen dimensions, timezone, language, installed plugins
- Behavioral signals: mouse movement entropy, keystroke timing on payment fields
- Device signals: touch capability, hardware concurrency, memory class
- Network signals: IP address and connection type (collected server-side)
These signals are sent to
q.stripe.comfor risk scoring. Stripe Radar uses this data to assign a fraud risk score to each payment attempt.
Cookies set (on stripe.com domain):
__stripe_mid(first-party on stripe.com, 1 year) — machine identifier for fraud detection__stripe_sid(first-party on stripe.com, 30 minutes) — session identifier for fraud detection
These cookies are set under stripe.com, not the merchant domain. On the merchant domain, Stripe.js does not set cookies — it uses the iframe isolation boundary.
Domains contacted: js.stripe.com, api.stripe.com, q.stripe.com, hooks.stripe.com, r.stripe.com (error reporting)
Consent & Compliance
GDPR/ePrivacy: Stripe.js is necessary for processing payments, covered by contractual necessity under GDPR Article 6(1)(b). Fraud detection processing is justified under legitimate interest (Article 6(1)(f)) — Stripe and the merchant both have a legitimate interest in preventing fraudulent transactions. Cookies set under stripe.com during a payment flow initiated by the user fall under the ePrivacy strictly necessary exemption for cookies needed to complete a user-requested transaction. Stripe acts as a data processor for the merchant and as an independent controller for fraud and risk data.
CCPA/CPRA: Payment data processing for transaction completion and fraud prevention is a necessary business operation exempt from opt-out requirements under CCPA.
EU-US Data Transfers: Stripe Inc. participates in the EU-US Data Privacy Framework (DPF) and offers Standard Contractual Clauses for EU payment data processing by Stripe's US entity.
PCI-DSS: Stripe.js's iframe architecture is designed to limit the merchant's PCI-DSS scope to SAQ A, the lowest level, as raw card data never enters the merchant's environment.
Consent category: Essential (payment processing) and Functional (saved payment methods, address collection).
Should You Block This Without Consent?
No. Stripe.js provides essential payment processing infrastructure. Blocking it prevents customers from completing purchases and renders the checkout page non-functional. The fraud detection data collection is a necessary security measure for payment processing under both GDPR legitimate interest and CCPA business necessity. Disclose Stripe as a payment processor in the site's privacy policy.
Products (5)
Consent Categories
Also Known As
Industries
Tracked Domains (2)
stripe.comFunctionalstripe.networkFunctionalFrequently Asked Questions
Does Stripe require cookie consent?
No. Stripe.js is essential payment processing infrastructure. Its fraud detection cookies (__stripe_mid, __stripe_sid) are set on the stripe.com domain during user-initiated payment flows, qualifying for the ePrivacy strictly necessary exemption. GDPR legal basis is contract performance and legitimate interest for fraud prevention.
What cookies does Stripe set?
Stripe sets __stripe_mid (1-year expiry) and __stripe_sid (30-minute expiry) on the stripe.com domain for fraud detection and session identification. No cookies are set on the merchant's own domain. Script loads originate from js.stripe.com/v3/ and API calls go to api.stripe.com and q.stripe.com.
How does ConsentStack handle Stripe?
ConsentStack classifies Stripe as essential and functional, and never blocks it. It is detected via js.stripe.com/v3/ script loads. Blocking Stripe would prevent checkout from functioning entirely, so ConsentStack allows it unconditionally and recommends disclosing it in the site privacy policy.
Related Vendors
Manage consent for Stripe
ConsentStack automatically detects and manages Stripe trackers so your site stays compliant with global privacy regulations.