Skip to content

Google AdSense

How to add Google AdSense to Nextjs

ref1 1. change script to Script

  1. change crossorigin to crossOrigin

  2. change id to .env by src={`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${process.env.NEXT_GOOGLE_ADSENSE_ID}`}

验证不通过Couldn't verify your site

刚添加好验证代码后,立即验证不通过,需要等一等。