Site monetization kit
The Monetization Stack
Most monetization advice is a list of accounts to sign up for. This kit is four small systems you drop into a static site once, then forget. They already run in production on live sites.
You get analytics you own with no monthly bill and affiliate links that tag and disclose themselves. You also get an ad setup that will not fight your content-security policy (CSP) and a deploy pipeline that stops the most common way a static site ships stale content.
The four systems
Owned analytics
A cookieless first-party beacon, an edge function that stores hits in your host's own key-value store, and a private dashboard. No third-party script, no monthly fee, and the data is yours. It replaces a paid analytics subscription.
Affiliate auto-tagging
A small script finds every Amazon link on a page, appends your tag if one is not already there, and adds the disclosure markup the Federal Trade Commission (FTC) expects. There is no per-link work and no double-tagging. Disclosure is a legal requirement, and a platform's built-in tag does not cover an outside Amazon link.
Ads without breaking your CSP
You get the exact CSP origins and Auto Ads setup that let Google's ads render on a strict site. You also get the list of pages to exclude to stay inside policy and the ad categories to block so a serious brand does not serve junk.
Drift-proof deploys
The most common static-site failure is a local command publishing an out-of-date copy over what your pipeline pushed to Git. The fix is to make Git the single source of truth so every push publishes itself. This one habit removes the entire class of "why is the old version live" bugs.
How you use it
- Add the analytics beacon and its two edge functions. Set one secret and open your private dashboard.
- Set your affiliate tag in one line and load the tagging script.
- Paste the ad origins into your headers, add the loader, enable Auto Ads, and apply the category blocks.
- Connect your repository for auto-deploy and retire the manual deploy command.
Each piece is independent, so you can do them in any order. Plan on an afternoon.
An honest note
Ads and affiliates earn in proportion to traffic. This kit makes a site ready to earn and removes the recurring analytics bill. It does not manufacture visitors. Delivered as-is: third-party platform behaviour, ad approval, and pricing are outside anyone's control, and nothing here is legal or tax advice.