├── docs ├── images │ ├── dashboard_demo.png │ ├── fraud-journey.png │ ├── github-banner.png │ └── fraud_waste_calculator.png ├── logos │ └── github_banner.PNG └── LOGO_ASSETS.md ├── babel.config.js ├── config ├── .prettierrc ├── .editorconfig ├── rollup.config.mjs ├── .eslintrc.json └── jest.config.js ├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ ├── bug_report.md │ └── feature_request.md ├── workflows │ └── ci.yml ├── PULL_REQUEST_TEMPLATE.md ├── SECURITY.md ├── CHANGELOG.md ├── CONTRIBUTING.md ├── CODE_OF_CONDUCT.md └── SUPPORT.md ├── .npmignore ├── .gitignore ├── LICENSE ├── examples ├── webflow │ └── README.md ├── github-pages │ └── README.md ├── integration.html ├── squarespace │ └── README.md ├── godaddy │ └── README.md ├── wordpress │ ├── README.md │ ├── demo-output.html │ └── INTEGRATION-GUIDE.md ├── wix │ ├── README.md │ └── INTEGRATION-GUIDE.md ├── README.md ├── shopify │ ├── README.md │ └── INTEGRATION-GUIDE.md └── bluehaven-coffee │ └── index.html ├── tests ├── integration │ ├── oneliner_test.html │ └── phase1_test.html ├── setup.js ├── manual │ ├── test-unload-fetch.html │ ├── simple_test.html │ ├── phase2_manual_test.html │ ├── test-unload.html │ ├── manual.html │ └── test-production.html └── unit │ ├── url.test.js │ ├── session.test.js │ └── fingerprint.test.js ├── src ├── utils │ ├── url.js │ ├── session.js │ └── fingerprint.js ├── index.js └── core │ └── tracker.js ├── package.json ├── index.d.ts └── dev ├── ground-truth ├── index.js └── impossibilities.js └── tests ├── test-merged-ground-truth.html └── test-ground-truth.html /docs/images/dashboard_demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papa-torb/adtruth/HEAD/docs/images/dashboard_demo.png -------------------------------------------------------------------------------- /docs/images/fraud-journey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papa-torb/adtruth/HEAD/docs/images/fraud-journey.png -------------------------------------------------------------------------------- /docs/images/github-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papa-torb/adtruth/HEAD/docs/images/github-banner.png -------------------------------------------------------------------------------- /docs/logos/github_banner.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papa-torb/adtruth/HEAD/docs/logos/github_banner.PNG -------------------------------------------------------------------------------- /docs/images/fraud_waste_calculator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/papa-torb/adtruth/HEAD/docs/images/fraud_waste_calculator.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | [ 4 | '@babel/preset-env', 5 | { 6 | targets: { 7 | node: 'current' 8 | } 9 | } 10 | ] 11 | ] 12 | }; 13 | -------------------------------------------------------------------------------- /config/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": true, 3 | "trailingComma": "none", 4 | "singleQuote": true, 5 | "printWidth": 100, 6 | "tabWidth": 2, 7 | "useTabs": false, 8 | "arrowParens": "avoid", 9 | "bracketSpacing": true, 10 | "endOfLine": "lf", 11 | "quoteProps": "as-needed" 12 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: true 2 | contact_links: 3 | - name: Security Vulnerability 4 | url: https://github.com/papa-torb/adtruth/security/advisories/new 5 | about: Please report security vulnerabilities through GitHub Security Advisories 6 | - name: Question or Discussion 7 | url: https://github.com/papa-torb/adtruth/discussions 8 | about: Ask questions or start discussions about AdTruth -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Development files 2 | .github/ 3 | .vscode/ 4 | .idea/ 5 | 6 | # Testing 7 | tests/ 8 | coverage/ 9 | jest.config.js 10 | .eslintcache 11 | 12 | # Documentation (keep README, LICENSE, CHANGELOG) 13 | docs/ 14 | examples/ 15 | 16 | # Configuration 17 | .editorconfig 18 | .eslintrc.json 19 | .prettierrc 20 | .babelrc 21 | rollup.config.mjs 22 | .gitignore 23 | 24 | # Source files (only ship dist/) 25 | src/ 26 | 27 | # Misc 28 | *.log 29 | .DS_Store 30 | .env* 31 | *.tmp 32 | *.temp 33 | 34 | # Git 35 | .git/ 36 | .gitattributes 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Node.js 2 | node_modules/ 3 | npm-debug.log* 4 | yarn-debug.log* 5 | yarn-error.log* 6 | lerna-debug.log* 7 | .pnpm-debug.log* 8 | 9 | # Build output 10 | # We commit dist/ for CDN access 11 | build/ 12 | 13 | # Testing 14 | coverage/ 15 | *.lcov 16 | .nyc_output 17 | 18 | # Development 19 | .env 20 | .env.local 21 | .env.*.local 22 | *.log 23 | .eslintcache 24 | 25 | # IDE 26 | .vscode/ 27 | .idea/ 28 | *.swp 29 | *.swo 30 | *~ 31 | .DS_Store 32 | 33 | # OS 34 | Thumbs.db 35 | .DS_Store 36 | .DS_Store? 37 | ._* 38 | 39 | # Documentation builds 40 | docs/_build/ 41 | 42 | # Temporary files 43 | *.tmp 44 | *.temp 45 | .tmp/ 46 | .temp/ 47 | # Credentials files - NEVER COMMIT 48 | adtruth-credentials.txt 49 | *-credentials.txt 50 | 51 | # Claude configuration 52 | .claude/ 53 | -------------------------------------------------------------------------------- /config/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig helps maintain consistent coding styles across different editors and IDEs 2 | # https://editorconfig.org 3 | 4 | root = true 5 | 6 | # Default settings for all files 7 | [*] 8 | charset = utf-8 9 | end_of_line = lf 10 | insert_final_newline = true 11 | trim_trailing_whitespace = true 12 | indent_style = space 13 | indent_size = 2 14 | 15 | # JavaScript and JSON files 16 | [*.{js,json,mjs}] 17 | indent_size = 2 18 | 19 | # Markdown files 20 | [*.md] 21 | trim_trailing_whitespace = false 22 | max_line_length = off 23 | 24 | # YAML files 25 | [*.{yml,yaml}] 26 | indent_size = 2 27 | 28 | # HTML files 29 | [*.html] 30 | indent_size = 2 31 | 32 | # Shell scripts 33 | [*.sh] 34 | indent_size = 4 35 | 36 | # Makefile 37 | [Makefile] 38 | indent_style = tab 39 | -------------------------------------------------------------------------------- /config/rollup.config.mjs: -------------------------------------------------------------------------------- 1 | import terser from '@rollup/plugin-terser'; 2 | 3 | export default [ 4 | // IIFE build for browser script tag 5 | { 6 | input: 'src/index.js', 7 | output: { 8 | file: 'dist/adtruth.js', 9 | format: 'iife', 10 | name: 'AdTruth', 11 | banner: '/* AdTruth SDK v0.2.1 | MIT License | https://github.com/papa-torb/adtruth */' 12 | } 13 | }, 14 | // Minified IIFE build for production 15 | { 16 | input: 'src/index.js', 17 | output: { 18 | file: 'dist/adtruth.min.js', 19 | format: 'iife', 20 | name: 'AdTruth', 21 | banner: '/* AdTruth SDK v0.2.1 | MIT */' 22 | }, 23 | plugins: [terser()] 24 | }, 25 | // ESM build for modern bundlers 26 | { 27 | input: 'src/index.js', 28 | output: { 29 | file: 'dist/adtruth.esm.js', 30 | format: 'es', 31 | banner: '/* AdTruth SDK v0.2.1 | MIT License | https://github.com/papa-torb/adtruth */' 32 | } 33 | } 34 | ]; 35 | // Note: This project is still under development. 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Hongyi 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /config/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2021": true, 5 | "node": true 6 | }, 7 | "extends": "eslint:recommended", 8 | "parserOptions": { 9 | "ecmaVersion": 2021, 10 | "sourceType": "module" 11 | }, 12 | "rules": { 13 | "indent": ["error", 2], 14 | "linebreak-style": ["error", "unix"], 15 | "quotes": ["error", "single"], 16 | "semi": ["error", "always"], 17 | "no-unused-vars": ["warn", { 18 | "argsIgnorePattern": "^_", 19 | "varsIgnorePattern": "^_" 20 | }], 21 | "no-console": ["warn", { "allow": ["warn", "error"] }], 22 | "prefer-const": "error", 23 | "no-var": "error", 24 | "eqeqeq": ["error", "always"], 25 | "curly": "error", 26 | "brace-style": ["error", "1tbs"], 27 | "comma-dangle": ["error", "never"], 28 | "object-curly-spacing": ["error", "always"], 29 | "array-bracket-spacing": ["error", "never"], 30 | "arrow-spacing": "error", 31 | "keyword-spacing": "error", 32 | "space-before-blocks": "error", 33 | "space-infix-ops": "error" 34 | }, 35 | "ignorePatterns": [ 36 | "node_modules/", 37 | "dist/", 38 | "*.min.js" 39 | ] 40 | } -------------------------------------------------------------------------------- /examples/webflow/README.md: -------------------------------------------------------------------------------- 1 | # Webflow Integration (Testing Required) 2 | 3 | **Priority**: ⚪ LOW (Professional/agency focus, not SMB target market) 4 | **Status**: 🚧 Deferred - Testing after high-priority platforms 5 | 6 | This integration guide is planned but requires testing before documentation. 7 | 8 | ## Testing Checklist 9 | 10 | - [ ] Test with free Webflow account 11 | - [ ] Test with paid site plan (Custom Code feature) 12 | - [ ] Verify tracking works in preview mode 13 | - [ ] Verify tracking works on published site 14 | - [ ] Test with Webflow CMS collections 15 | - [ ] Test with custom interactions/animations 16 | - [ ] Document Custom Code settings location 17 | 18 | ## Potential Integration Methods 19 | 20 | 1. **Project Settings → Custom Code** (Site plan required) 21 | 2. **Embed Component** (limited, may not persist) 22 | 3. **Before
7 |This page uses ONLY the one-liner. No additional code.
9 |Scroll, click, move mouse to test Phase 2 tracking!
10 | 11 | 12 | 13 | 14 |Keep scrolling...
16 |tag in Project Settings** 23 | 24 | ## Known Considerations 25 | 26 | - Custom Code is only available on paid site plans ($14+/month) 27 | - Free accounts cannot add custom scripts 28 | - May need to handle Webflow's page transitions 29 | 30 | --- 31 | 32 | **Want to help?** Test AdTruth on your Webflow site and report findings! 33 | -------------------------------------------------------------------------------- /examples/github-pages/README.md: -------------------------------------------------------------------------------- 1 | # GitHub Pages Integration (Testing Required) 2 | 3 | **Priority**: ⚪ LOW (Developer community, not SMB target market) 4 | **Status**: 🚧 Deferred - Testing after high-priority platforms 5 | 6 | This integration guide is planned but requires testing before documentation. 7 | 8 | ## Testing Checklist 9 | 10 | - [ ] Test with static HTML (no generator) 11 | - [ ] Test with Jekyll (GitHub's default) 12 | - [ ] Test with Hugo 13 | - [ ] Test with custom domain 14 | - [ ] Test with github.io subdomain 15 | - [ ] Verify tracking works after Jekyll build 16 | - [ ] Document _includes or _layouts integration 17 | 18 | ## Potential Integration Methods 19 | 20 | 1. **Direct HTML** (static sites) 21 | 2. **Jekyll _includes partial** (reusable across pages) 22 | 3. **Jekyll _layouts/default.html** (site-wide) 23 | 4. **Hugo baseof.html template** (Hugo sites) 24 | 25 | ## Known Considerations 26 | 27 | - Jekyll may process HTML/JS during build 28 | - Need to ensure CDN URL isn't modified 29 | - May need to use `{% raw %}` and `{% endraw %}` tags in Jekyll to prevent Liquid processing 30 | - Build process might affect script loading 31 | 32 | --- 33 | 34 | **Want to help?** Test AdTruth on your GitHub Pages site and report findings! 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Report a bug or unexpected behavior 4 | title: '[BUG] ' 5 | labels: 'bug' 6 | assignees: '' 7 | --- 8 | 9 | ## Bug Description 10 | 11 | A clear and concise description of what the bug is. 12 | 13 | ## Steps to Reproduce 14 | 15 | 1. Go to '...' 16 | 2. Click on '...' 17 | 3. Scroll down to '...' 18 | 4. See error 19 | 20 | ## Expected Behavior 21 | 22 | A clear and concise description of what you expected to happen. 23 | 24 | ## Actual Behavior 25 | 26 | What actually happened instead. 27 | 28 | ## Environment 29 | 30 | - **AdTruth Version**: [e.g., v0.2.1] 31 | - **Browser**: [e.g., Chrome 120, Safari 17] 32 | - **OS**: [e.g., Windows 11, macOS 14, iOS 17] 33 | - **Platform**: [e.g., WordPress 6.4, Shopify, Wix, Static HTML] 34 | 35 | ## Screenshots 36 | 37 | If applicable, add screenshots to help explain your problem. 38 | 39 | ## Console Errors 40 | 41 | If applicable, paste any JavaScript console errors: 42 | 43 | ``` 44 | Paste console errors here 45 | ``` 46 | 47 | ## Additional Context 48 | 49 | Add any other context about the problem here (e.g., does it happen on all pages or just some?). 50 | 51 | ## Possible Solution 52 | 53 | If you have ideas on how to fix this, please share. -------------------------------------------------------------------------------- /tests/integration/oneliner_test.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |
5 | 6 |
35 |