Purplelink
← All kits

Site monetization kit

The Monetization Stack

Most monetization advice is a list of accounts to sign up for. This is the opposite: four small systems you drop into a static site once, then forget. They are already running in production on live sites, not sketches.

You get analytics you actually own with no monthly bill, affiliate links that tag and disclose themselves, an ad setup that will not fight your content-security policy, and a deploy pipeline that stops the single most common way a static site quietly 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 FTC expects. There is no per-link work and no double-tagging. Disclosure is a legal requirement, not a nicety, and a platform's built-in tag does not cover an outside Amazon link.

Ads without breaking your CSP

The exact content-security-policy origins and Auto Ads setup that let Google's ads render on a strict site, 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

  1. Add the analytics beacon and its two edge functions; set one secret and open your private dashboard.
  2. Set your affiliate tag in one line and load the tagging script.
  3. Paste the ad origins into your headers, add the loader, enable Auto Ads, and apply the category blocks.
  4. Connect your repository for auto-deploy and retire the manual deploy command.

Each piece is independent. Do them in any order; none depends on another. Plan on an afternoon.

What you get: the cookieless analytics beacon, two serverless functions (a collector and a token-gated aggregator), and a self-contained dashboard; the Amazon affiliate auto-tagger; the AdSense configuration (loader, ads.txt, and the Content-Security-Policy that actually lets ads run); a full README; and a beautifully typeset setup guide. Delivered as a source archive plus the guide. The analytics pieces cost nothing to run.

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.