The Optimizely hack: what it teaches teams that use Tag Manager
In November, attackers used a website testing tool to put malicious code on the sites of 178 organizations, including Zoom, the BBC and HSBC. None of those companies' own code was touched. The lessons apply to any team that adds code to its site through a marketing tool, and that includes everyone using Google Tag Manager.
The short answer
Any tool that can add JavaScript to your site without a developer's deploy is part of your website, and it deserves the same care as your code. For Tag Manager, that comes down to a few habits: know who can publish, turn on 2-step verification for custom code, prefer built-in tags over Custom HTML, keep a list of every script the site loads, and talk with your developers about a Content Security Policy. Keep using Tag Manager, and run it like the production tool it is.
On this page
What happened
On November 16, 2026, an attacker exploited a vulnerability in Optimizely's Web Experimentation product and added malicious code to some customers' Project JavaScript, a field that runs on every page where the Optimizely snippet loads. The file still came from Optimizely's own servers, so to the affected sites it looked like the normal testing script.
The code tried to steal payment card details, cookies and screenshots, and to swap cryptocurrency wallet addresses. Report URI, the security company that spotted it, found the code in 188 snippets belonging to 178 organizations. Optimizely says it closed the vulnerability within three hours and removed the injected code from every affected project, and that it reset access for affected user accounts.
Optimizely wasn't the only marketing script targeted. Researchers reported an earlier wave of the same campaign through Kissmetrics, an analytics tool, and two other vendors' scripts. In late July, a script from the ad platform Adform was altered to swap wallet addresses.
Why this is a marketing tools story
Optimizely's Project JavaScript works a lot like a Custom HTML tag in Tag Manager. Both let someone add code to every page of a live site from a web interface, with no code review and no deploy. That's why marketing teams like them, and it's also why attackers do.
The people and settings that control these tools now control part of your website. Most teams approve a vendor once, add its script, and never look at the setup again.
| Where the code lives | Who can change it | What to check |
|---|---|---|
| Tag Manager Custom HTML tags and Custom JavaScript variables | Anyone with publish access to the container | Publish list, 2-step verification setting, version history |
| A/B testing and personalization tools | Users of the testing account | User list, 2-step verification or single sign-on, unused projects |
| Consent banner (CMP) scripts | Users of the CMP account | User list, which scripts the banner loads |
| Chat, review and survey widgets | Users of each vendor account | Whether the tool is still in use |
| Hard-coded snippets, CMS plugins and apps | Developers, site admins, app installers | Whether anyone still owns them |
Five habits worth building
1. Know who can publish
In Tag Manager, anyone with publish permission on a container can change what runs on your live site the moment they click Publish. Review the user list, remove people and agencies who no longer work with you, and keep publish rights with a small group who know what every tag does. Editors can still build and test changes; someone accountable publishes them.
2. Turn on 2-step verification for custom code
Tag Manager has an account setting that requires 2-step verification before anyone can create or change Custom HTML tags, Custom JavaScript variables or user settings. It takes a minute for an administrator to turn on, and it means a stolen password isn't enough to add custom code.
Do the same for your other script tools. Ask your A/B testing, chat and review vendors whether they support single sign-on or 2-step verification, and turn it on.
3. Prefer built-in tags and templates over Custom HTML
Tag Manager's built-in tags and community templates declare what they're allowed to do, such as which domains they can load scripts from. A Custom HTML tag can do anything. When a vendor offers a template, use it. When you do need Custom HTML, write down what it does and who asked for it in the version notes, so the next person isn't left guessing.
4. Keep a list of every script your site loads
You can't protect what you don't know is there. Keep a short list of every tool that loads code on your site, whether through Tag Manager, a hard-coded snippet, a CMS plugin or a Shopify app, along with who owns each one and why it's there. Remove anything nobody uses. Fewer scripts means fewer vendors whose security you depend on, and usually a faster site.
The same list helps with consent and privacy questions. When someone asks what's running on your site, you'll have the answer.
5. Talk with your developers about a Content Security Policy
A Content Security Policy (CSP) tells browsers which domains a page may load scripts from and send data to. It wouldn't have stopped the Optimizely script itself from loading, because Optimizely's domain was approved. But a strict policy can stop the code that script tries to load next, and the data it tries to send out. According to Report URI, only 24 of the affected organizations, about 15 percent of those it could check, had a policy strict enough to block the payload.
A CSP has tradeoffs for marketing teams, and it's worth knowing them before your developers turn one on. Every new vendor domain has to be added to the policy, or the tag will quietly fail. On my own site, a strict policy stopped Tag Manager's Custom JavaScript variables from working, because they rely on a browser feature (eval) the policy blocks. The fix was to move that logic into a small script on the site itself and pass the values to Tag Manager through the data layer.
That's the kind of tradeoff to plan for together. A CSP is a developer and security decision; your part is making sure the list of tools it allows matches the tools you actually use.
A 30-minute check you can run this week
- Open the user list in Tag Manager, for both the account and each container. Ask of every name: who is this, do they still work with us, do they need publish access?
- Check the 2-step verification setting in Tag Manager's Account Settings. Turn it on if it's off.
- List your Custom HTML tags and Custom JavaScript variables. For each one, can someone on your team say what it does? If not, mark it for review.
- Read the last few versions in the container's version history. Do you recognize every change and every person who published?
- See what the site actually loads. Open your browser's developer tools on a key page, go to the Network tab, reload, and look at the domains scripts come from. Compare them with your list of tools.
- Ask your other vendors (testing, chat, reviews, personalization) who on your team can change their scripts, and whether 2-step verification is on.
- Ask your developers whether the site has a Content Security Policy, and how new vendor domains get added to it.
If you use Optimizely Web Experimentation, follow Optimizely's own guidance and your security team's lead on whether your site was affected. That review sits outside this check.
Questions people ask
Should we stop using Tag Manager?
No. Tag Manager is often easier to review than scripts scattered through a site's code, because it keeps a version history of every change and who published it. The habits above make it safer.
Does server-side Tag Manager prevent this?
Not on its own. Server-side tagging changes where some data is sent, but a vendor script loaded in the visitor's browser still runs there.
We use Optimizely. Were we affected?
Optimizely has contacted affected customers and published its findings. Your security team and Optimizely are the right people to confirm it for your account.
