授权数字卖家 (ads.txt) 是一项 IAB Tech Lab 计划,旨在协助您仅通过认定的授权卖家(如 AdSense)销售您的数字广告资源。创建自己的 ads.txt 文件后,您可以更好地掌控允许谁在您的网站上销售广告,并可防止向广告客户展示仿冒广告资源。
https://support.google.com/adsense/answer/7532444?hl=zh-Hans&ref_topic=7533328
禁止抓取ads.txt文件
如果某个网域中的 robots.txt 文件不允许以下任意一项,则抓取工具可能会忽略该网域的 ads.txt 文件:
- 抓取用于发布 ads.txt 文件的网址路径。
- 抓取工具的用户代理。
示例:不允许通过 ads.txt 文件路径进行抓取
对于 example1.com:
- ads.txt 文件发布在
example1.com/ads.txt
上。 -
example1.com/robots.txt
中包含以下行:User-agent: *
Disallow: /ads
- 遵守 robots.txt 标准的抓取工具会忽略 ads.txt 文件。
- 您可以按如下方法修改 robots.txt 文件以允许抓取文件(也可以采用其他方法):
- 方法 1:修改不允许抓取的路径。
User-agent: *
Disallow: /ads**/**
* 方法 2:明确允许 ads.txt;这取决于抓取工具对Allow
robots.txt 指令的支持情况。
>User-agent: *
>**Allow: /ads.txt**
>Disallow: /ads
- 方法 1:修改不允许抓取的路径。
示例:不允许针对用户代理进行抓取
对于 example2.com:
- ads.txt 文件发布在
example2.com/ads.txt
上。 -
example2.com/robots.txt
中包含以下行:User-agent: Googlebot
Disallow: /
- Google 抓取工具会忽略 ads.txt 文件。
来源:https://support.google.com/adsense/answer/7679060?hl=zh-Hans&ref_topic=7533328