zoukankan      html  css  js  c++  java
  • 在你的网站中使用 AdSense广告

    下面介绍了如何使用Google的AdSense来为你的网站设置广告。基本内容包括:

    • 创建一个AdSense账号,你必须18岁以上,有一个Google账号以及地址 
    • 你的网站必须已经被激活,并且你的网站内容必须符合AdSense政策 
    • 创建响应式布局广告单元,可以在任何的设备上自动调整广告大小
    • 确保payment的设置,坐等钱来 

    创建一个包含广告的简单网页

    在排练预演中,你将要创建一个包含响应式广告的简单页面,使用Google AdSense和Web Start Kit。

    Sample website with ads on desktop and mobile

    如果你不熟悉 Web Start Kit, 参考 Set Up Web Starter Kit 文档

    为了让你的网站包含广告且赚钱,你需要遵循以下步骤 

    1. 创建一个 AdSense账号
    2. 创建广告单元(ad units)
    3. 将你的广告放置在页面上 
    4. 设置你的payment

    创建一个AdSense账号

    为了使用AdSense服务,你首先得创建一个AdSense账号,创建账号得遵从如下条件:

    • 你至少18岁以上且拥有一个已确认的谷歌账号
    • 你有一个符合Google AdSense项目政策的网站,查看具体条约,请点击:Google AdSense program policies
    • 你有一个和你的银行账户相关联的邮局地址亦或email地址,来收取你赚的钱 

    创建广告单元

    一个广告单元是一系列将展现在你网页中的广告,它们将通过你网页中的js来实现。你有以下三种方式来控制你广告单元的大小:

    如果你的网站是响应式布局的网站,那么使用响应式布局的广告。如果你不使用响应式布局广告单元模式,那么你讲书写一大堆的代码来让广告在不同设备上显示不同的大小。

    在Google AdSense 中Guide to ad sizes 中追踪最好的广告大小 top performing ad sizes 。

    创建响应式布局广告单元

    1. Visit the My ads tab.
    2. Click +New ad unit.
    3. Give your ad unit a unique name. This name appears in the ad code that’s pasted into your site, so be descriptive.
    4. Select Responsive from the Ad size drop-down.
    5. Select Text & display ads from the Ad type drop-down.
    6. Click Save and get code.
    7. In the Ad code box that appears, select the Smart sizing (recommended) option from the Mode drop-down. This is the recommended mode and doesn’t require you to make any changes to your ad code.

    创建你的广告单元之后,AdSense 提供了一个包含你的网站的代码,相似如下:

    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- Top ad in web starter kit sample -->
    <ins class="adsbygoogle"
      style="display:block"
      data-ad-client="XX-XXX-XXXXXXXXXXXXXXXX"
      data-ad-slot="XXXXXXXXXX"
      data-ad-format="auto"></ins>
    <script>
      (adsbygoogle = window.adsbygoogle || []).push({});
    </script>

    Note

    •  data-ad-client 和 data-ad-slot 对每一个你创建的广告而言都是独一无二的
    •  data-ad-format=auto 标签在创建广告代码时允许响应式布局广告单元中的广告自适应设备大小

    将广告单元包含到你的网站中

    为了将广告包含到你的网站中,你需要在你的网页中嵌入上面AdSense生成的代码。

    如果你想要生成多个广告,你得为你的广告重新使用广告模式亦或创建多个广告单元。

    1. 在app文件夹中打开index.html 
    2. 将你的代码嵌入到main标签中
    3. 保存文件,打开浏览器使用谷歌开发工具中的移动端设备视图查看效果 

    Remember

    • 将所有的广告代码放置在body标签里面,否则,广告将不会起作用! 
    Sample website with ads on desktop and mobile

    设置payment参数

    想知道在AdSense中你如何获利?

    1. Verify you’ve provided any required tax information in the payee profile.
    2. Confirm your payee name and address are correct.
    3. Select your form of payment on the Payment settings page.
    4. Enter your personal identification number (PIN). This PIN verifies the accuracy of your account information.
    5. Check to see if your balance reaches the payment threshold.

    查看跟多消息: Intro to AdSense payments 

    原文:https://developers.google.com/web/fundamentals/discovery-and-monetization/monetization-with-ads/include-ads?hl=en

  • 相关阅读:
    【BZOJ2227】【ZJOI2011】看电影 [组合数][质因数分解]
    【BZOJ2648】SJY摆棋子 [KD-tree]
    【BZOJ3237】【AHOI2013】连通图 [CDQ分治]
    【BZOJ1901】Dynamic Rankings [整体二分]
    【BZOJ2527】【POI2011】Meteors [整体二分]
    【BZOJ3624】【APIO2008】免费道路 [生成树][贪心]
    【BZOJ2663】灵魂宝石 [二分]
    【BZOJ4653】【NOI2016】区间 [线段树]
    【BZOJ2049】【SDOI2008】洞穴勘测 [LCT]
    【BZOJ4008】【HNOI2015】亚瑟王 [期望DP]
  • 原文地址:https://www.cnblogs.com/RachelChen/p/5456231.html
Copyright © 2011-2022 走看看