使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
我们使用一系列元标记来帮助扩展您的广告投放平台。下面列出了各种元标记及其用途。
元标记语法:
<meta name="google-adsense-platform-account" content="{host-property-code}">
其中的 {host-property-code} 如下所示:ca-host-pub-1234567890123456
。托管媒体资源代码是您的 AdSense 发布商 ID,前面附有“ca-host-”。您可以通过以下方式找到您的 AdSense 发布商 ID:访问 AdSense,然后依次点击账号 > 设置 > 账号信息。
此元标记具有以下三种用途:
- 帮助 AdSense 为自定义网域定制新手入门说明
如果使用自定义网域的用户直接访问 AdSense 以注册新账号或将其网站添加到当前账号,并且 AdSense 在包含托管媒体资源代码的页面上检测到此元标记,则 AdSense 会向该用户显示您为注册流程选择的自定义新手入门说明。
- 帮助您的平台以可扩展的方式实现 ads.txt
如果平台的网页上已有现有的 AdSense 广告代码,或者允许用户自行添加 AdSense 广告代码,则很难更新广告代码以确保它们包含 data-ad-host 参数(请参阅 ads.txt 部分,了解为何这一点很重要)。此元标记可用于向来自该网页的所有 AdSense 广告请求自动添加 data-ad-host 参数,除非发出广告请求的广告代码已经设置了 data-ad-host 参数。这意味着,ads.txt 文件可以只有托管发布商 ID 这一行内容。
- 启用涵盖整个平台的效果报告和收益分成
如上所述,此元标记可确保网页上的所有 AdSense 广告请求都具有 data-ad-host 参数(除非生成广告请求的广告代码已具有 data-ad-host 参数)。因为所有广告请求都拥有托管发布商 ID,所以这些流量将开始显示在平台的 AdSense 账号中。如果您的平台已设置收益分成,此收益分成也将开始应用于平台上的所有流量。
如果网页上存在此标记的多个实例,系统会将网页上第一个标记的值传递到所有 AdSense 广告请求,并忽略第二个标记。
子账号
元标记语法:
<meta name="google-adsense-account" content="{child-account}">
其中,{child-account} 是 AdSense 内容广告客户名称中的广告客户。示例为:ca-pub-0000000000000000。
在网站验证流程中,AdSense 会扫描网页并执行所有权检查。您可以通过多种方式帮助子账号通过所有权检查,包括通过 ads.txt、广告代码或此元标记。最佳方法取决于您的网址结构和其他因素。请与您的客户经理联系,咨询适合您平台的最佳方法。
平台网域
元标记语法:
<meta name="google-adsense-platform-domain" content="{platform-domain}">
其中的 {platform-domain} 是在初始配置期间向您的客户经理提供的网域。
如果您的平台支持自定义网域,当用户选择直接在 AdSense 中添加网站(而不是在您平台的控制台中启动该流程)时,我们会使用此元标记(与“google-adsense-platform-account”元标记搭配使用)向用户显示自定义的新手入门说明。
元标记语法:
<meta name="google-adsense-platform-author-url" content="{author-url}">
其中的 {author-url} 是公共根网址,或在此网页上创作内容的用户的个人资料网址。我们仅要求针对网址结构是网址中不显示创建者 ID 的网域使用此元标记。请参阅以下示例情形:
使用场景 |
网址结构 |
{author-url} 值 |
是否需要元标记 |
子网域 |
根:
https://littlepig.example.com
内容:
https://littlepig.example.com/food.html
|
littlepig.example.com |
否 |
子文件夹 |
根:
https://example.com/littlepig
内容:
https://example.com/littlepig/food.html
|
example.com/littlepig |
否 |
子网域和子文件夹的组合 |
根:
https://sites.example.com/sites/littlepig
内容:
https://sites.example.com/sites/littlepig/food.html
|
sites.example.com/sites/littlepig |
否 |
单个网址 |
根(或者创作者个人资料):
https://example.com/user/littlepig
内容:
https://example.com/nf8ag4n
|
example.com/user/littlepig |
否 |
例如,对于“单个网址”用例,元标记应如下所示:
<meta name="google-adsense-platform-author-url" content="example.com/user/littlepig">
根据此元标记中的信息,我们会按照内容检查系统中所用的平台用户来细分网址。尽管上表中显示不需要此元标记,我们还是建议您使用。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
[null,null,[],[[["\u003cp\u003eMeta tags streamline ad serving, onboarding, and reporting for platforms using AdSense.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egoogle-adsense-platform-account\u003c/code\u003e tag helps customize onboarding, implement ads.txt, and enable platform-wide performance reporting with revenue share.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egoogle-adsense-account\u003c/code\u003e tag facilitates child account ownership verification during the site verification process in AdSense.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egoogle-adsense-platform-domain\u003c/code\u003e and \u003ccode\u003egoogle-adsense-platform-author-url\u003c/code\u003e tags support custom domain onboarding and content segmentation for platforms, respectively.\u003c/p\u003e\n"]]],["Meta tags are used to scale ad serving on platforms. The `google-adsense-platform-account` tag uses the host property code to customize onboarding, implement scalable ads.txt, and enable performance reporting/revenue-share. The `google-adsense-account` tag aids child account verification. The `google-adsense-platform-domain` tag shows customized onboarding instructions on custom domains. Finally, `google-adsense-platform-author-url` tags content with the author's URL for content checking systems.\n"],null,["Meta tags\n---------\n\nWe use a series of meta tags to help scale your platform for ad serving. Below is a list of meta tags and their purpose.\n\n### Platform account\n\nMeta tag syntax: \n\n \u003cmeta name=\"google-adsense-platform-account\" content=\"{host-property-code}\"\u003e\n\nWhere {host-property-code} looks like this: `ca-host-pub-1234567890123456`. The host property code is your AdSense publisher ID, with \"ca-host-\" prepended to it. You can find your AdSense publisher ID by visiting AdSense: [Account \\\u003e Settings \\\u003e Account information](https://adsense.google.com/adsense/settings/account-information).\n\nThis meta tag has three purposes, it:\n\n- **Helps AdSense customize onboarding instructions for custom domains** \n If a user on a custom domain visits AdSense directly to either sign-up for a new account, or add their site to their current account, and AdSense detects this meta tag on the page with your host property code, then AdSense will show the user the custom onboarding instructions you selected for the sign-up flow.\n- **Helps your platform implement ads.txt in a scalable way** \n If a platform already has pre-existing AdSense ad codes on its pages, or allows its users to add AdSense ad codes by themselves, it can be difficult to update the ad tags to ensure they have the data-ad-host parameter (see the [ads.txt section](/adsense/platforms/transparent/ads-txt) to understand why this is important). The meta tag is used to automatically add a data-ad-host parameter to all AdSense ad requests originating from that page, unless the ad code that issued the ad request already has a data-ad-host parameter set. This means that the ads.txt file can be just one line, using the host publisher ID.\n- **Enables platform wide performance reporting and revenue-share** \n As explained above, the meta tag ensures that all AdSense ad requests on the page have the data-ad-host parameter present (unless the ad code that generated the ad request already has the data-ad-host parameter present). As all ad requests will have the host publisher ID, this traffic will start appearing in the platform AdSense account. If your platform has a revenue share set, this revenue share will start applying to all traffic on the platform as well.\n\nIf there are multiple instances of this tag on the page, the value of the first tag on the page is passed to all AdSense ad requests, and the second tag is ignored.\n\n### Child account\n\nMeta tag syntax: \n\n \u003cmeta name=\"google-adsense-account\" content=\"{child-account}\"\u003e\n\nWhere {child-account} is the ad client from the [AdSense for Content ad client name](/adsense/management/reference/rest/v2/accounts.adclients). It will look like this: ca-pub-0000000000000000.\n\nDuring the site verification process, AdSense will scan pages and perform an ownership check. There are multiple ways to help child accounts pass the ownership check, including through ads.txt, ad codes or this meta tag. The best approach will depend on your URL structure and other factors. Please contact your account manager for a consultation on the best approach for your platform.\n\n### Platform domain\n\nMeta tag syntax: \n\n \u003cmeta name=\"google-adsense-platform-domain\" content=\"{platform-domain}\"\u003e\n\nWhere {platform-domain} will be the domain provided to your account manager during the [initial configuration](/adsense/platforms/transparent/initial-tasks#choose_your_initial_configuration).\n\nIf your platform supports custom domains, we use this meta tag to show customized onboarding instructions to your users (in combination with the \"google-adsense-platform-account\" meta tag) if they choose to add their site directly in AdSense instead of starting the process in your platform's console.\n\n### Platform author URL\n\nMeta tag syntax: \n\n \u003cmeta name=\"google-adsense-platform-author-url\" content=\"{author-url}\"\u003e\n\nWhere {author-url} is the public root URL, or profile URL of the user who created the content on this page. We only require this meta tag for domains where the URL structure is such that the ID of the creator isn't available in the URL. See the example scenarios below:\n\n| Use case | URL structure | {author-url} value | Is meta tag required? |\n|-------------------------------------------|---------------------------------------------------------------------------------------------------------------------|-----------------------------------|-----------------------|\n| Subdomains | Root: https://littlepig.example.com \u003cbr /\u003e Content: https://littlepig.example.com/food.html | littlepig.example.com | No |\n| Sub folders | Root: https://example.com/littlepig \u003cbr /\u003e Content: https://example.com/littlepig/food.html | example.com/littlepig | No |\n| Combination of subdomains and sub folders | Root: https://sites.example.com/sites/littlepig \u003cbr /\u003e Content: https://sites.example.com/sites/littlepig/food.html | sites.example.com/sites/littlepig | No |\n| Individual URLs | Root (or creator profile): https://example.com/user/littlepig \u003cbr /\u003e Content: https://example.com/nf8ag4n | example.com/user/littlepig | No |\n\nAs an example for the \"Individual URLs\" use case, the meta tag should look like this: \n\n \u003cmeta name=\"google-adsense-platform-author-url\" content=\"example.com/user/littlepig\"\u003e\n\nWe use the information in this meta tag to segment URLs by platform users which is used in our content checking systems. We recommend having this meta tag present, even if not required as per the table above."]]