Safeguard
Security Guides•

Which pages should not run marketing tags?

Keep marketing tags off pages that handle credentials, payments or account details, or run them in a controlled way. A page by page decision guide.

Safeguard Security Team
4 min read

Keep third party marketing tags off pages where a script could see credentials, payment details or sensitive personal data, such as login, password reset, payment and account settings pages. Where a tag is truly needed there, run it in a tightly controlled way and review it as code.

Why page choice matters

A tag that runs on a page can read what is on that page. OWASP's third party JavaScript guidance lists three risks: loss of control over client changes, arbitrary code execution, and disclosure of data to third parties. The more sensitive the page, the more each of those costs. A homepage tag that goes wrong is a bad day. A tag that goes wrong on a login form is an incident.

This is a guide to risk, not a rule from a regulator. Your own obligations depend on your sector and law, so check with counsel.

A decision table

Page typeDefault stanceWhy
Public marketing and blog pagesTags allowed with reviewLittle sensitive data on the page
Pricing and sign up startAllowed, narrow triggersIntent data, but no secrets
Login and password resetNo marketing tagsCredentials typed here, tokens in URLs
Payment and checkoutMinimal, controlled scripts onlyCard data theft by injected script is a known pattern
Account and settingsNo marketing tags by defaultPersonal details on screen
Health, finance or children's contentStrictest review, often noneHigher sensitivity and stricter rules in many places
Internal tools and adminNo marketing tagsNo reason for third parties to be there

OWASP's page mentions payment data theft through injected JavaScript, so payment pages deserve the tightest approach. See payment page scripts and SAQ A.

How to enforce the split

  1. Separate containers or environments. Use one container for public pages and none, or a minimal one, for sensitive areas.
  2. Trigger conditions. Exclude sensitive paths in every trigger, with a block list that is checked on release.
  3. CSP per area. A stricter policy on sensitive paths stops tags from loading even if a trigger slips.
  4. Server side events. Where a conversion on a sensitive page matters, send a minimal event from your server instead of loading a vendor script.
  5. Test. Walk each sensitive flow with the network panel open and confirm no third party requests appear.

Handling the conversion argument

Marketing teams often want to measure checkout or sign up completion. You can usually measure the step before and the confirmation after without running a vendor script during entry of sensitive details. A thank you page with a generic event gives the result without giving a script a view of the form.

Be careful with the URL of the thank you page too. If it carries an order number or email, the tag will carry it out. See personal data in URLs sent to analytics.

Make it a standing rule

Write the table into your tag policy and review it when the site structure changes. New pages inherit tags by default in many setups, so the rule has to be a block list that someone owns.

Quick check

Is it safe to run analytics on a login page?

Avoid it. If you must measure it, count visits server side and keep third party scripts off the page.

Can a strict CSP replace the page rules?

It adds a second layer. Keep both, since a tag allowed by policy can still read the page.

Where Safeguard fits

Safeguard's policies and gates can hold code changes behind review, and dependency scanning plus SBOM cover shipped packages. Try the free scan.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.