Skip to content

Open-source ad fraud detection for small businesses using machine learning. Detect click fraud and bot traffic from Google Ads, Facebook Ads, and other platforms. Completely free.

License

Notifications You must be signed in to change notification settings

papa-torb/adtruth

AdTruth - Stop Fake Traffic. Start Real Growth.

License: MIT CI Status Bundle Size Live Demo

Open-source ad fraud detection for small businesses

Live DemoQuick StartWhy DifferentContribute

Founded by Hongyi Shui


Ad Fraud Detection for Small Businesses

Detect click fraud, bot traffic, and fake conversions from Google Ads, Facebook Ads, Instagram, and TikTok. AdTruth is a free, open-source ad fraud detection tool that helps small businesses identify which advertising platforms waste their budget on fraudulent traffic.

You're spending $3,000/month on paid ads. Conversion rate: 5%.

30% of those clicks might be fake.

Not obvious bots—AI-powered ad fraud that mimics human behavior perfectly. Natural mouse movement. Human-like scrolling. They visit your page, bounce after 8 seconds. You just paid $2.50 for nothing.

Enterprise fraud detection tools (ClickCease, CHEQ, TrafficGuard) cost thousands per month.

We built AdTruth to give small businesses the same ad fraud visibility, completely free. Detect bot traffic and fraudulent clicks across all your advertising platforms. See which channels waste your budget on fake traffic and shift spending to real customers.


The Reality of Ad Fraud and Click Fraud

The Problem

30% of paid traffic is fraudulent

  • Bot farms generate fake clicks
  • AI mimics real user behavior perfectly
  • Click fraud costs you $1-3 per $10 spent
  • Platforms filter obvious bots, but sophisticated fraud slips through

Your campaigns look fine. The fraud is invisible.

The Double Cost

Two ways you're losing money

  • Fraud waste: $2-10K/year on bot clicks
  • Solution cost: $5K-50K/year for enterprise tools
  • Small businesses face both problems
  • Can't afford visibility, can't stop the bleeding

Without fraud analytics, you're flying blind.

The Solution

$0 forever with AdTruth

  • See fraud rates across Google, Facebook, Instagram, TikTok
  • Compare: "Google 11% fraud vs Instagram 63% fraud"
  • Shift budget from high-fraud to low-fraud platforms
  • 12KB script—lighter than most images

One line of code. Free forever. Open source.

Know which platforms waste your money. Shift budget to what works.

Get Started →View DemoRead Docs


How Fraud Works

Ad fraud flow visualization

The fraud economy: Fake websites generate clicks → Fraudsters profit → Your budget disappears → Real customers never see your ads

AdTruth reveals which platforms have higher fraud rates, so you can shift budget from high-fraud channels to low-fraud ones.


See It In Action

Calculate Your Fraud Waste (Estimated fraud rates. Real data available once you connect)

AdTruth fraud waste calculator

Try it yourself: adtruth.io • Enter your website to see estimated fraud rates across Google, Facebook, Instagram, and TikTok

Your Dashboard After Connection

AdTruth analytics dashboard

Real-time insights:

  • See which platforms waste money on bots vs attract real customers
  • Compare your fraud rates to industry benchmarks
  • Get actionable recommendations

How AdTruth Works

1. Install → Add one line of code to your website (takes 60 seconds)

2. Collect → AdTruth automatically tracks visitor behavior and fraud signals

3. Analyze → Our ML models calculate fraud rates for each traffic source

4. Optimize → See platform-by-platform fraud rates (e.g., "Google: 11%, Instagram: 63%")

5. Reallocate → Shift budget from high-fraud platforms to channels with real customers

Zero configuration. No maintenance. Just install and go.


Quick Start

Get started in 60 seconds • No credit card required • Free forever

Universal Installation (Works on Any Website)

Add this script before the closing </body> tag:

<script>
(function(d, s, id) {
    var js, fjs = d.getElementsByTagName(s)[0];
    if (d.getElementById(id)) return;
    js = d.createElement(s); js.id = id;
    js.src = 'https://cdn.jsdelivr.net/gh/papa-torb/adtruth@latest/dist/adtruth.min.js';
    js.onload = function() {
        AdTruth.init('YOUR_API_KEY_HERE');
    };
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'adtruth-js'));
</script>

Get your free API key: Sign up at adtruth.io (takes 30 seconds)


Platform-Specific Guides

WordPress - ✅ TESTED

Time: 2 minutes • Difficulty: Easy • Tested: Verified working

WordPress powers 43% of all websites. We've tested and confirmed this integration works perfectly.

Quick Steps:

  1. Install the WPCode plugin (2M+ active installations)
  2. Go to Code Snippets → Header & Footer
  3. Paste the AdTruth script in the Footer section
  4. Click Save Changes

View detailed WordPress guide →

Shopify - ✅ TESTED

Time: 3 minutes • Difficulty: Easy • Tested: Verified working

Modern Shopify stores use Custom Pixels for tracking scripts. This is the recommended method.

Quick Steps:

  1. Go to Settings → Customer Events
  2. Click Add Custom Pixel
  3. Name it "AdTruth Fraud Detection"
  4. Paste the AdTruth initialization code
  5. Click Save

View detailed Shopify guide →

Wix

Time: 2 minutes • Difficulty: Easy

Quick Steps:

  1. Go to Settings → Custom Code in your Wix dashboard
  2. Click + Add Custom Code
  3. Paste the AdTruth script
  4. Set to load on All Pages in the Body - end
  5. Click Apply

View detailed Wix guide →

Other Platforms

We have tested integration guides for:


Who AdTruth Helps

Business Type Common Problem How AdTruth Helps
E-commerce High ad spend, low ROAS Identify which platforms attract bots vs real shoppers
SaaS Companies Fake signups waste sales time Distinguish real leads from click farm accounts
Local Businesses Limited budget, blind spending See which platforms deliver real foot traffic
Marketing Agencies Clients blame poor results on you Prove fraud with data, not guesswork
Developers Want to contribute to open source Help build better fraud detection for everyone

AdTruth Comparison with Industry Solutions

Feature AdTruth Enterprise Tools
(ClickCease, CHEQ, etc.)
Google Analytics
Cost $0 forever ❌ $12K-50K/year ✅ Free
Fraud Detection ✅ ML-powered, real-time ✅ Advanced (black box) ⚠️ Basic bot filtering only
Network Intelligence Learns from all sites ❌ Your data only ❌ No fraud focus
Tracking Transparency 100% open source ❌ Proprietary black box ❌ Proprietary
Setup Time 60 seconds ⏱️ Days to weeks ⏱️ 5 minutes
Best For Small businesses Large enterprises Basic analytics

The AdTruth Advantage

Enterprise-grade fraud analytics without enterprise pricing. Your traffic data helps train models that benefit the entire network. When we detect fraud patterns on one site, every other business gets better fraud scoring immediately.


FAQ

Will this slow down my website?

No. AdTruth is 12KB minified (smaller than most images) and loads asynchronously. It won't block your page rendering or affect your Core Web Vitals scores.

Do I need to be technical to use this?

Not at all. Copy-paste one line of code into your website (takes 60 seconds). The dashboard shows everything in plain English with color-coded fraud scores.

How do you make money if it's free?

We don't—yet. AdTruth is a public good project. Small businesses deserve the same fraud protection as Fortune 500 companies. We're building this as an open-source community effort first, monetization later (if ever).

Can I use this with Google Analytics?

Absolutely! AdTruth is complementary to Google Analytics. GA shows you traffic patterns; AdTruth tells you which traffic is fraudulent. Use them together for complete visibility.

What if I have a WordPress/Shopify/Wix site?

AdTruth works with any website:

  • WordPress: Add the script to your theme's header.php or use a code injection plugin
  • Shopify: Add to theme.liquid in the <head> section
  • Wix: Use the Custom Code feature in Site Settings
  • Squarespace: Use Code Injection in Settings
Is my data private?

Yes. We collect only anonymized behavioral signals (mouse patterns, scroll depth, device signatures). No personal information. No emails. No names. No passwords. We're GDPR and CCPA compliant by design.

How accurate is the fraud detection?

Our ML models are trained on collective network data from all participating sites. Average fraud detection rate across industries is 15-40%. Accuracy improves as more businesses join the network—every fraudster we catch protects everyone.

Can I self-host AdTruth?

Yes! It's 100% open source (MIT license). Clone the repo, modify it, host it yourself. We encourage transparency and customization. Check the For Developers section for build instructions.


How AdTruth Detects Fraud

AdTruth uses a multi-layered approach to identify fraudulent traffic:

  • Browser fingerprinting - Unique device signatures that bots can't fake
  • Behavioral analysis - Real users scroll, move, and click differently than bots
  • Machine learning - Isolation Forest models trained on collective network data
  • Network intelligence - Fraud patterns detected on one site protect all sites

Why we don't share all our methods: Disclosing detailed detection techniques helps fraudsters bypass them. Our open-source SDK is transparent, but our ML models and detection rules remain proprietary to stay ahead of evolving fraud.


Privacy & Compliance

AdTruth is designed with privacy as a core principle:

  • GDPR compliant - No personal data collection
  • CCPA compliant - Users can opt-out anytime
  • No PII storage - We don't collect names, emails, or addresses
  • Cookie-less tracking - Works without third-party cookies
  • Encrypted in transit - All data encrypted via HTTPS
  • Respects Do Not Track - Honors browser privacy settings
  • Open source - Audit the code yourself

What we collect:

  • Anonymized behavioral signals (mouse patterns, scroll depth)
  • Technical attributes (browser type, screen resolution)
  • Campaign parameters (UTM codes from ad links)

What we DON'T collect:

  • Personal information (names, emails, phone numbers)
  • Payment information
  • Precise geolocation
  • Browsing history outside your website

For Developers

Building from Source

# Clone the repository
git clone https://github.com/papa-torb/adtruth.git
cd adtruth

# Install dependencies
npm install

# Build for production
npm run build

# Build for development (with watch)
npm run dev

# Run tests
npm test

Project Structure

adtruth/
├── src/
│   ├── core/           # Core tracking logic
│   ├── fingerprint/    # Browser fingerprinting
│   ├── behavior/       # Behavioral analysis
│   └── utils/          # Helper functions
├── dist/               # Built files
├── tests/              # Test suite
└── rollup.config.js    # Build configuration

Contributing Code

We welcome contributions! Every improvement you make helps protect thousands of businesses.

How to contribute:

  1. Fork the repository and create a feature branch
  2. Write tests for your changes
  3. Follow our coding standards (ESLint + Prettier configured)
  4. Submit a pull request with a clear description

Areas where we need help:

  • New fraud detection techniques
  • Performance optimizations
  • Browser compatibility testing
  • Documentation improvements
  • Translation to other languages

Not a developer? You can still help:

  • Report bugs or fraud patterns you've discovered
  • Improve documentation
  • Share AdTruth with other small business owners
  • Contribute to discussions and feature ideas

See CONTRIBUTING.md for detailed guidelines.


Roadmap

Current Version (v0.2.1)

  • ✅ Browser fingerprinting
  • ✅ Behavioral analysis (mouse, scroll, touch)
  • ✅ UTM campaign tracking
  • ✅ Real-time dashboard
  • ✅ ML-based fraud scoring
  • ✅ Page unload tracking (accurate session duration)
  • ✅ Platform integration guides (WordPress, Shopify, Wix)

Coming Next (v0.3.0)

  • 🔄 Advanced ML models (ensemble methods)
  • 🔄 Honeypot trap implementation
  • 🔄 WebGL fingerprinting
  • 🔄 Page visibility tracking
  • 🔄 Email/Slack alerts for fraud spikes

Future Vision (v1.0+)

  • 📋 Open fraud dataset for researchers - Preview documentation
  • 📋 Community-contributed fraud rules
  • 📋 Plugin marketplace (WordPress, Shopify, etc.)
  • 📋 API for third-party integrations
  • 📋 Mobile app for on-the-go monitoring

Want to influence the roadmap? Open an issue or join the discussion.


Community & Support

Get Help

Stay Updated

  • Star this repo to show support
  • 👀 Watch releases to get notified of updates
  • 📋 Read the CHANGELOG for version updates

Spread the Word

The more businesses that use AdTruth, the better it works for everyone. Share with:

  • Other small business owners
  • Marketing agencies
  • Developer communities
  • Anyone paying for online advertising

License

This project is licensed under the MIT License - see the LICENSE file for details.

What this means:

  • ✅ Use AdTruth commercially
  • ✅ Modify the code
  • ✅ Distribute your own versions
  • ✅ Private use
  • ⚠️ Must include copyright notice
  • ⚠️ No warranty provided

Acknowledgments

  • Founded by Hongyi Shui - Building fraud protection for small businesses
  • Inspired by research from Stanford, MIT, and industry fraud detection papers
  • Special thanks to the open-source community for making projects like this possible

AdTruth - Protecting your ad spend through collective intelligence

Made with care for small businesses everywhere


Note: This project is still under development.

About

Open-source ad fraud detection for small businesses using machine learning. Detect click fraud and bot traffic from Google Ads, Facebook Ads, and other platforms. Completely free.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published