Why Marketing Tags Do Not Belong on Payment Pages
Security Intermediate 7 min read

Why Marketing Tags Do Not Belong on Payment Pages

Marketing tags on payment pages turn any vendor breach into a card skimmer. Why to keep A/B testing and analytics off checkout, and what PCI DSS requires.

Published: November 25, 2026 • Updated: November 25, 2026
payment securitypci dsse-skimmingmarketing tags

Marketing tags on payment pages give every analytics, experimentation and advertising vendor the ability to read card numbers, CVVs and wallet addresses as your customers type them. When one of those vendors is compromised, as Optimizely was on 16 November 2026, that access becomes a skimmer on your checkout without a single change to your own code. This article makes the case for keeping marketing tags off payment and transfer pages, explains what PCI DSS now requires, and shows how to win the argument internally.

What the Optimizely incident showed about checkout pages

The Optimizely supply chain attack delivered the same payload to every visitor of 178 organizations, but what it could steal depended entirely on which page the visitor was on. On a news article it swapped cryptocurrency addresses in page text and the clipboard. On a page with a card form it watched every form submission and POST request for a Luhn-valid card number, expiry and CVV, and sent all three to the attacker. Optimizely's own report says the script targeted card details typed into forms on the site itself and cryptocurrency transfers, and that cards entered in hosted payment iframes such as Stripe or Adyen were not accessible.

The first item on Optimizely's action list for every customer was to confirm which pages the snippet ran on during the exposure window, and to treat the risk as high if it ran on any page with card entry or a crypto transfer. Its eighth item was to remove the snippet from pages that handle payment or crypto input where no experiment is running. That is a vendor telling its customers, after the fact, what this article argues they should decide in advance.

Why do marketing tags on payment pages carry more risk than elsewhere?

A script running on a page can read anything on that page, including what the visitor types into form fields before the form is submitted. On a payment page that includes the full card number, expiry date and security code, which together are enough to make fraudulent purchases. The same script on a product page can only see the product.

Every tag on a page shares the same JavaScript context. There is no sandbox between your checkout form and a vendor's script unless you build one with an iframe. An A/B testing tool does not need to read card fields to do its job, but it can, and so can anyone who gains the ability to edit its code. The Optimizely attacker did not steal any customer's password; a flaw in the signup flow let them act as an administrator on targeted accounts and edit Project JavaScript. Any vendor with a dashboard and a custom-code field has an equivalent attack surface, and you cannot audit the vendor's signup flow.

The exposure also fires before consent. Infoblox's Zach Edwards told KrebsOnSecurity that experimentation snippets are placed as close to the top of the page as possible so they render first, and are set up to run on page load rather than wait for a consent dialog. The payload on most affected sites ran the moment the page loaded.

What does PCI DSS require for scripts on payment pages?

PCI DSS version 4 added Requirements 6.4.3 and 11.6.1 specifically to address scripts on payment pages, and the PCI Security Standards Council says they became effective on 31 March 2025. Requirement 6.4.3 calls for every script on a payment page to be authorized, integrity-checked and listed in an inventory with a written justification. Requirement 11.6.1 calls for a mechanism that alerts personnel to unauthorized changes to the HTTP headers and contents of payment pages as the consumer's browser receives them.

The Council published an information supplement in March 2025, "Payment Page Security and Preventing E-Skimming", to guide implementation of both requirements. Its framing is direct: scripts running in consumers' browsers are now a significant target for attackers seeking to steal payment card data, and the requirements exist to ensure payment page scripts are properly authorized, checked for integrity and monitored for tampering.

Read the two requirements against a marketing tag on checkout. The written justification for an A/B testing snippet on the payment page is usually "marketing wanted to test the button colour". The integrity check is impossible for a snippet that changes whenever anyone edits an experiment. The tamper detection has to notice a change inside a file that changes legitimately all the time. The cheapest way to satisfy 6.4.3 for that script is to not have it on the page.

The hosted iframe difference

Optimizely's report makes a point that explains why some affected retailers had no card exposure at all: cards entered in hosted payment iframes were out of the script's reach. A payment iframe loads the card form from the payment processor's domain inside a frame, and the browser's same-origin rules stop scripts on the parent page from reading inside it. The card number never exists in your page's JavaScript context, so a compromised tag cannot see it.

If your checkout still renders card fields in your own HTML, moving to a hosted field or iframe integration from your processor removes most of the problem in one change. It also shrinks your PCI scope, because the payment page scripts that 6.4.3 covers no longer handle card data directly. The hosted iframe does not cover everything: the Optimizely payload still swapped crypto addresses, stole non-HttpOnly cookies and took screenshots on those pages. But the card data, the part with the clearest legal and financial consequence, is gone from reach.

How to make the case to marketing

Marketing teams add tags to checkout for legitimate reasons: conversion tracking, abandoned-cart recovery, experiments on the payment form. The argument is not that these goals are wrong. It is that the data they need can be collected without a vendor script running in the same context as the card form.

Three positions tend to work:

  1. Conversion data can come from the server. The order confirmation page, or a server-side event sent to the analytics vendor after the payment succeeds, records the same conversion without any script on the payment step.
  2. Experiments on checkout can run with a reduced vendor footprint. Optimizely's own post-incident guidance is to remove the snippet from payment pages with no active experiment. Make "an active, named experiment with an end date" the condition for the tag to be present, and remove it when the experiment ends.
  3. The vendor's compromise is your breach. Report URI's advice to affected organizations included considering whether to tell their customers that they had served them malware. Salesforce disabled Optimizely scripts across all its properties while it investigated. The marketing team will not be the one drafting the customer notification.

Bring the Optimizely numbers. Of 159 affected organizations Report URI evaluated, 68 had no Content Security Policy and 50 had one that let the payload through. The protected 24 had restricted which hosts their pages could load scripts from and send data to. A Content Security Policy is the second half of the answer; it limits what a compromised tag can do everywhere. Removing tags from payment pages removes the question on the pages that matter most.

A policy you can adopt this quarter

Written as a standing rule, the position is short enough to fit in a change-management policy:

  • No third-party script runs on a page that collects card data, bank details or cryptocurrency addresses unless it is required to process the payment.
  • Analytics and conversion events for those pages are sent server-side after the transaction completes.
  • Experimentation tags may run on a payment page only for a named experiment with a documented end date, approved by security, and are removed when it ends.
  • Card fields are rendered in a hosted iframe from the payment processor, not in the site's own HTML.
  • Every script on every page is listed in the inventory produced by the third-party JavaScript audit, with an owner and a justification, and the Content Security Policy enforces that list.

What if the business insists on testing checkout?

Run the experiment with the tag present only for its duration, on the specific page it needs, behind an enforced Content Security Policy that blocks script loads and data connections to any host other than the vendor's own, and with card fields inside a hosted iframe the tag cannot read. Record the start and end dates so that if the vendor is compromised during the window, you know exactly which transactions to review.

That arrangement would have left an Optimizely customer on 16 November with no card exposure, no cookie exfiltration and a one-line answer to the incident report's first question.