How To Add Google AdSense To Hugo + PaperMod Website
Visit pacebits.com for my recent projects
Goal
Add Google AdSense to the website to monetize it 💸💸
Prerequisites
- Website built with Hugo and PaperMod theme
- Google AdSense account
Steps
- Add the website to Google AdSense account.
- [Optional] Config Ads setting in Google AdSense.
- Get AdSense code snippet, which should be similar to the following:
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=xxxxxxxxxx" crossorigin="anonymous"></script> - Create file
layouts/partials/extend_head.htmlin the code of the website, if it doesn't exist.- Note: the content of this file will be added to
<head>...</head>of the page by PaperMod.
- Note: the content of this file will be added to
- Paste "AdSense code snippet" into
layouts/partials/extend_head.html. - Create file
static/ads.txtin the code of the website, if it doesn't exist. - Paste "Ads.txt snippet" from AdSense into
static/ads.txt - Verify the change locally, and deploy it.
- Submit review request in Google Adsense, and wait for the processing.
DONE!
Older PostDNSSEC Explained
DNSSEC enhances DNS security by ensuring responses are from authenticated origins, though it doesn't encrypt traffic or solve "last-mile" security issues.
Newer PostHow To Integrate ChatGPT With Apple HomeKitIntegrating ChatGPT with Apple HomeKit using iOS Shortcuts for smart home device control with natural language commands, step-by-step guide provided.
