AdSense Setup

A short guide to configuring Google AdSense for VanTools. These values are publishable identifiers — but they should still be set as environment variables, not pasted into the project knowledge base, chat, or shared docs.

Variables

  • VITE_ADSENSE_CLIENTRequired

    Your AdSense publisher ID. Loads the AdSense script and tags every ad slot.

    Example: ca-pub-1234567890123456

  • VITE_ADSENSE_SLOT_DEFAULTOptional

    Default ad slot ID used when an <AdSlot> is rendered without an explicit slot prop.

    Example: 1234567890

Where to set them

  1. Add them as project environment variables in your hosting / deployment settings (the VITE_ prefix exposes them to the client at build time).
  2. For local development, place them in a local .env file that is git-ignored.
  3. After updating values, redeploy so Vite re-bundles them into the client.

Do not store in a knowledge base

Even though AdSense IDs are publishable, treat configuration values like infrastructure:

  • Never paste them into AI chats, knowledge bases, README files, or issue threads.
  • Never commit them in source files — only reference them via import.meta.env.
  • Rotate or replace them through your hosting provider's environment settings only.

How VanTools uses them

The root layout injects the AdSense script only when VITE_ADSENSE_CLIENT is set. Each <AdSlot /> falls back to a styled placeholder until both the client ID and a slot ID are available, so the app stays functional in development without ads.