Find out whose code is running on your website.
Analytics, chat widgets, cookie banners and marketing tags all run other companies’ code on your pages. Six steps to find them, cut them down and protect the accounts that control them.
Most business websites run code that someone else wrote and someone else hosts: analytics, chat widgets, cookie banners, booking forms, review badges and marketing tags. Each one runs on your pages with the same access as your own content, so if one of those companies is compromised, your visitors can be attacked through your site. That’s what happened in this week’s Optimizely hack. This guide shows you how to check third-party scripts on your website and cut the risk down.
1. Ask for the list
Start with whoever built or looks after your site. Ask them for every outside service that adds code to it, what each one is for, and who has the login. Then look yourself in the places code gets added:
- Plugins or apps in your website platform, such as WordPress plugins or Shopify apps.
- Any “custom code” or “header code” box in your site settings.
- Google Tag Manager, if you use it. Tags added there don’t show up anywhere else.
2. Check what actually loads
The list and reality often differ. In Chrome or Edge, open your home page, right-click and choose Inspect, then open the Network tab, click JS and reload the page. Every script that loads is listed with the address it came from. Note anything that isn’t your own domain. Do the same on your contact page and checkout, which often load extra tools.
3. Remove what you don’t use
Go through the list and ask what each one does for you today. Old analytics, trial tools, and chat widgets nobody answers are risk with no benefit, and they slow your site down. If nobody can say why it’s there, remove it and see if anyone notices.
4. Lock down the accounts
Anyone who can log in to one of these tools can change the code on your website. For your website platform, your tag manager and every tool that adds code:
- Turn on MFA. Our guide on turning on MFA covers how.
- Remove people who have left and agencies you no longer work with.
- Make sure the account belongs to your business, not to a freelancer’s personal email.
5. Keep card details off your own pages
If you take payments, use your payment provider’s hosted checkout or embedded payment form, so card details are typed into the provider’s page rather than yours. In the Optimizely attack, card forms hosted by providers such as Stripe and Adyen weren’t affected.
6. Ask your developer about a Content Security Policy
A Content Security Policy is a setting on your website that tells browsers which places your pages may load code from and send data to. It won’t help if a tool you’ve allowed is itself compromised, but a strict one can stop stolen details being sent to an attacker’s server. It needs testing, as a badly written policy can break parts of your site.
Keep it up to date
Save the list and check it again whenever you add a new tool, and at least twice a year. It only takes a few minutes once you’ve done it the first time.
Sources
- Help Net Security: Malware spread through Optimizely hits 178 organizations (17 November 2026)
- Chrome for Developers: Inspect network activity
More on this. See every guide and story on these topics, or follow Ashley on LinkedIn for a short post most days.