Skip to main content

TubeSentry

Local-first placement auditor and Model Context Protocol (MCP) server for Google Ads and DV360.

CI Tests Documentation PyPI version License: MIT Python 3.10+ M8ven Verified

Documentation: https://flovv.github.io/tubesentry/


Description

TubeSentry analyzes placement reports ("Where ads showed") from Google Ads (YouTube, Performance Max, Demand Gen) and Google Display & Video 360 (DV360). It categorizes placements against known risk patterns, quantifies wasted media spend, calculates an impression-weighted quality score, and generates exclusion lists for Google Ads Editor.

Processing runs 100% locally. Client placement data, impressions, and budgets never leave your machine.

Tags: google-ads, youtube-ads, performance-max, dv360, adtech, ppc, mcp-server, placement-exclusions, marketing-analytics


What TubeSentry Detects

When running YouTube or Performance Max campaigns, broad placement algorithms frequently allocate budget to non-converting or unintended inventory:

  • Made for Kids (MFK): Toddler songs and children's cartoons streamed on shared mobile devices, leading to accidental taps and COPPA compliance concerns.
  • Passive Audio & Music: 24/7 background lo-fi streams, ambient sleep tracks, and white-noise loops where visual engagement is minimal.
  • Underage Gaming: Channels dedicated to mobile sandbox titles (Roblox, Minecraft) that generate high view counts with negligible conversion value.
  • Foreign Script Delivery: Placements running on non-target language scripts (Cyrillic, Devanagari, Arabic, Thai) within domestic campaigns.
  • Low-Quality Content Farms: Automated short-form compilations designed for view arbitrage with high bounce rates.
  • Performance Sinkholes: Placements that exceed 3x target CPA without registering conversions.
  • Creative Alignment Gap: Optional analysis comparing your creative's intended target audience with the actual channels where impressions ran.

Installation

pip install tubesentry

Or run directly without installation using uvx:

uvx --from tubesentry tubesentry --help

Quickstart

1. Run a Synthetic Demo Audit

Generate a 25,000-row synthetic placement report and review the audit output:

tubesentry demo --out-dir ./demo_output

2. Audit an Exported Placement CSV

Export your placement report from Google Ads (Reports > Predefined reports > Other > Where ads showed > Download CSV) or DV360:

tubesentry audit where_ads_showed.csv --lang en,de --cpa 45.0

3. Compare Creative Intent to Actual Delivery

Pass your YouTube ad URL or creative brief text to compare target audience expectations against delivery reality:

tubesentry audit where_ads_showed.csv \
  --ad-url "https://youtube.com/watch?v=your_ad_id" \
  --ad-text "B2B infrastructure platform for DevOps and cloud architects"

4. Export Google Ads JavaScript Automation

Generate a copy-paste Google Ads Script snippet that automatically creates or populates an account-level Shared Placement Exclusion List:

tubesentry audit where_ads_showed.csv --export-script cleanup_placements.js

Paste into Google Ads (Tools & Settings > Bulk Actions > Scripts) and schedule to run daily or weekly.


Integrations

Google Ads Scripting Ecosystem

For media buyers who maintain automation by pasting JavaScript snippets into Google Ads, TubeSentry outputs a self-contained script with a built-in DRY_RUN preview mode:

tubesentry export script --report where_ads_showed.csv --out cleanup.js --list-name "TubeSentry Waste Shield"
  • Shared List Mode (Default): Applies exclusions account-wide across Video, Performance Max, and Demand Gen campaigns without hitting individual campaign limits.
  • Campaigns Mode: Targets specific campaigns matching a name filter via --mode CAMPAIGNS.
  • Safe Preview: Defaults to DRY_RUN = true so media buyers can review logs before applying live exclusions.

BigQuery Data Transfer Service (DTS) & dbt

For analytics and data engineering teams querying raw Google Ads Data Transfer Service tables (p_Placement_*), TubeSentry generates an optimized BigQuery Standard SQL query:

# Standard BigQuery SQL query
tubesentry export bigquery --out tubesentry_audit.sql --dataset google_ads_export

# dbt model format (with partitioning and clustering)
tubesentry export bigquery --out models/tubesentry_audit.sql --dbt

Evaluates heuristics (Made-for-Kids, passive audio, underage gaming, foreign language scripts) directly in BigQuery without moving data out of your data warehouse.


Python API

TubeSentry supports localized Google Ads CSV exports (English, German, Spanish, French, Italian, Dutch):

import tubesentry as ts

report = ts.audit_placements(
    report="where_ads_showed.csv",
    target_languages=["en", "de"],
    target_cpa=40.0,
    ad_url="https://youtube.com/watch?v=your_ad_id",
    ad_text="B2B cloud infrastructure monitoring for SRE teams.",
)

print(f"Audited Spend:    EUR {report.total_spend:,.2f}")
print(f"Wasted Spend:     EUR {report.total_wasted_spend:,.2f} ({report.wasted_spend_percentage:.1f}%)")
print(f"Quality Score:    {report.weighted_quality_score:.1f} / 10.0")

if report.creative_alignment:
    print(f"Alignment Score:  {report.creative_alignment.overall_alignment_score:.1f} / 10.0")
    print(f"Off-Target Spend: EUR {report.creative_alignment.off_target_spend:,.2f}")

MCP Server (Claude Desktop, Claude Code, Cursor)

TubeSentry includes a native Model Context Protocol (FastMCP) server, allowing AI coding assistants and agents to inspect placements and channels directly.

Claude Desktop Configuration

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "tubesentry": {
      "command": "uvx",
      "args": ["--from", "tubesentry", "tubesentry-mcp"]
    }
  }
}

Cursor Configuration

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "tubesentry": {
      "command": "uvx",
      "args": ["--from", "tubesentry", "tubesentry-mcp"]
    }
  }
}

Agent Skill

TubeSentry includes an installable skill (youtube-placement-audit) formatted with standard frontmatter for AI coding assistants and agent environments (Claude Code, Cursor, Antigravity, Codex).

Install via skills.sh / npx

Install directly to your agent configuration using the open skills standard:

npx skills add flovv/tubesentry

Install via TubeSentry CLI

tubesentry skill install

Or run without installation via uvx:

uvx --from tubesentry tubesentry skill install

This places SKILL.md into your workspace (.agents/skills/ or .claude/skills/), providing autonomous agents with:

  • Operational recipes for analyzing Google Ads / DV360 placement reports
  • Waste category decision rules and CPA thresholds
  • FastMCP tool invocation patterns and creative targeting fit guides

To view the raw skill instructions directly in the terminal:

tubesentry skill show

Editions

Feature Open-Core (Free) Pro (Licensed)
Waste category breakdown and percentage Yes Yes
Impression-weighted quality score (1-10) Yes Yes
Worst-offender channel reporting Top 25 unmasked All unmasked
Bundled waste seed database Curated seed channels + heuristics Curated seed DB + Parquet index & SQLite cache
Channel metadata resolution Local heuristics 50-ID batch YouTube API v3 enricher
Google Ads Editor exclusion CSV No Yes (reactive & 65k-capped exclusion CSVs)
DV360 SDF exclusion chunks No Yes (10,000-row SDF blocks)
Creative targeting fit engine Core matching Multimodal creative profiler
Client HTML presentation deck No Yes (single-file HTML report)

Pro Activation

TubeSentry Pro (Monthly, $199/mo) is available via Polar.

After purchasing, download your platform wheel (.whl) from the Polar Customer Portal and activate via CLI:

tubesentry auth --key tube_-XXXX-XXXX-XXXX --wheel path/to/tubesentry_pro-*.whl

Or via Python:

import tubesentry as ts

ts.install_pro(api_key="tube_-XXXX-XXXX-XXXX", local_path="path/to/tubesentry_pro-*.whl")

Security & Privacy

  • Local execution: All CSV parsing, heuristic scoring, and database lookups run locally.
  • No cloud ingestion: Client spend numbers, impressions, and account identifiers are never transmitted to external servers.
  • No telemetry: The core package does not collect analytics or track usage.

License

MIT License. See LICENSE for details.

Metadata

Release files for tubesentry 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tubesentry 0.1.2
File Size Uploaded Provenance Actions
tubesentry-0.1.2.tar.gz 87.8 kB Without provenance Details for tubesentry-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tubesentry 0.1.2
File Interpreter ABI Platform Actions
tubesentry-0.1.2-py3-none-any.whl Python 3 none any Details for tubesentry-0.1.2-py3-none-any.whl

Total release size: 142.6 kB

Release files / tubesentry-0.1.2.tar.gz

Download URL tubesentry-0.1.2.tar.gz
Size 87.8 kB
Tags Source
SHA-256 checksum
How to use checksums
bd88fcb30a0f15b99e6513c25258fd1a1294bc15e84fb880270e4b37eb9fd70d
BLAKE2b-256 checksum
How to use checksums
3c8cb94c5efa4bc44193ef09d21fb6fbc09f3c2b707c25c307492375380ff02e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / tubesentry-0.1.2-py3-none-any.whl

Download URL tubesentry-0.1.2-py3-none-any.whl
Size 54.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
13dce427ffa4dc6d9ae65e925c6ffb289d25d00c4c657f94d3e920afcaf630a3
BLAKE2b-256 checksum
How to use checksums
2b446ff74b6b219a760776d7ba310c16e7dd16f4d0343ac2848aee3e2f8f155c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for tubesentry 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page