Google Adsense

Add Google Adsense to your Webflow site

What does this do?

Google AdSense requires a special file at /ads.txt on your website, which Webflow does not support. Here we add that capability with a worker.

  • Serves Google's required /ads.txt file, configured as you need

  • Config is stored in CF's KV's

Google Adsense & Others

Google Adsense and other advertising platforms require an /ads.txt file for verification.

This tool is a standalone worker, and is designed to work with a Cloudflare KV store;

Key: HOSTNAME-ads.txt

Value: Content you want, multiline should work if desired

HOSTNAME does NOT include www. for consistency. Other subdomains can be used.

e.g. key -

This is done because Workers and KV store is account wide, while you may have multiple sites under it which need varying configurations.

Designed for situations like Google Adsense

File is

Here's an example;


Base domain refers to the "naked domain" with no subdomains, e.g. When we refer to base domain, BASEDOMAIN, make certain to use yours.


  • Setup adsense account

  • Verify site ownership

  • Get the ads.txt snippet e.g., pub-4476147977893911, DIRECT, f08c47fec0942fa0


  • Add worker path * Assign to Google Adsense worker

  • Add config to ADS_TXT KV store, e.g. key - value - the ads.txt snippet

Test it;

Visit your site url with /ads.txt appended


  • Validate

  • May take days or a week.


Adsense is kind of cool, you can simply turn on "auto" and let it go nuts with ad placements.

  • It places a lot of ads... I've see up to 3 per article, interstitially within the article text.

  • It places popups that can appear after a few seconds

  • Content must be good

Last updated