个人网站添加谷歌广告

工具

  • 能翻墙上Google的网络
  • 网站源码

添加步骤详解

  1. 注册谷歌账号Gmail

  2. 注册谷歌搜索Google search console
    关联网站URL,将代码添加到<head>标签中
     <!--谷歌网站有所权验证-->
     <meta name="google-site-verification" content="mQhRK1NyQjtVsm41qLVxKym8EQOK9xG__uEJhCILEKA" />
    
  3. 注册谷歌分析Google Analytics
    关联网站URL,将代码添加到<head>标签中
     <!-- Global site tag (gtag.js) - Google Analytics -->
     <script async src="https://www.googletagmanager.com/gtag/js?id=UA-138073963-1"></script>
     <script>
         window.dataLayer = window.dataLayer || [];
         function gtag(){dataLayer.push(arguments);}
         gtag('js', new Date());
         gtag('config', 'UA-138073963-1');
     </script>
    
  4. 注册谷歌广告Google AdSense
    关联网站URL,将代码添加到<head>标签中
     <!--Google AdSense-->
     <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
     <script>
         (adsbygoogle = window.adsbygoogle || []).push({
             google_ad_client: "ca-pub-3748292772197234",
             enable_page_level_ads: true
         });
     </script>
    

赞赏支持

取消

打赏,支持一下!

扫码支持
扫码支持

打开支付宝/微信扫一扫,即可扫码打赏哦!