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_CLIENTRequiredYour AdSense publisher ID. Loads the AdSense script and tags every ad slot.
Example:
ca-pub-1234567890123456VITE_ADSENSE_SLOT_DEFAULTOptionalDefault ad slot ID used when an <AdSlot> is rendered without an explicit slot prop.
Example:
1234567890
Where to set them
- Add them as project environment variables in your hosting / deployment settings (the
VITE_prefix exposes them to the client at build time). - For local development, place them in a local
.envfile that is git-ignored. - 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.