Back to cheatsheets
Privacy
Privacy Policy & Tracking Detection
Detect tracking pixels, find GDPR/CCPA compliance gaps, and compare disclosed vs actual tracking.
What you'll learn
- Detect common tracking pixels
- GDPR compliance checklist
How to use these snippets
- Click the Copy button next to any snippet to copy it to your clipboard.
- Paste the code into your project, IDE, or terminal.
- Replace placeholder values (like
example.comoryour-secret) with your actual data. - Review the code comments for important security notes and caveats.
- Try the interactive related tool to see the concept in action.
Code Snippets
Copy-paste code snippets
2 ready-to-use snippets for privacy policy & tracking detection. Click copy and paste into your project.
Detect common tracking pixels
const TRACKERS = {
'Google Analytics': 'google-analytics.com',
'Google Tag Manager': 'googletagmanager.com',
'Facebook Pixel': 'connect.facebook.net',
'TikTok Pixel': 'analytics.tiktok.com',
'Hotjar': 'static.hotjar.com',
'Mixpanel': 'cdn.mxpnl.com',
'Segment': 'cdn.segment.com',
'Amplitude': 'cdn.amplitude.com',
'LinkedIn Insight': 'snap.licdn.com',
'Twitter Pixel': 'static.ads-twitter.com',
};
function detectTrackers(html) {
const found = [];
for (const [name, domain] of Object.entries(TRACKERS)) {
if (html.includes(domain)) {
found.push({ name, domain });
}
}
return found;
}
GDPR compliance checklist
const GDPR_CHECKS = [
'Explicit consent mechanism for cookies',
'Cookie banner with reject option',
'Privacy policy linked and accessible',
'Data processing legal basis stated',
'User rights section (access, deletion, portability)',
'DPO contact information listed',
'Data retention period specified',
'Third-party data sharing disclosed',
'Cross-border transfer mechanism noted',
'Right to withdraw consent mentioned',
];
function checkGDPR(policyText) {
return GDPR_CHECKS.map(check => ({
requirement: check,
found: policyText.toLowerCase().includes(
check.split(' ')[0].toLowerCase()
),
}));
}
Tool
Related ShieldX tool
Try this concept hands-on with the interactive tool.
100% Free · No signup · No cost
Generate something unguessable right now
148 bits of entropy, a crack-time estimate you can trust, and a clipboard that clears itself after 30 seconds.
Part of the Toolly ecosystem · secure.toolly.site