使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
我们使用一系列元标记来帮助扩展您的广告投放平台。下面列出了各种元标记及其用途。
元标记语法:
<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 广告请求添加 data-ad-host
参数。如果您在广告代码中添加了 data-ad-host
参数,则此操作是多余的。
如果网页上存在此标记的多个实例,系统会将网页上第一个标记的值传递到所有 AdSense 广告请求,并忽略第二个标记。
子账号
元标记语法:
<meta name="google-adsense-account" content="{sub-account}">
其中,{sub-account} 是账号名称中的第二个发布商 ID,前面附有“ca-”。示例为:ca-pub-0000000000000000。
在网站验证流程中,AdSense 会扫描网页并执行所有权检查。您可以通过多种方式帮助子账号通过所有权检查,包括通过 ads.txt、广告代码或此元标记。最佳方法取决于您的网址结构和其他因素。请与您的客户经理联系,咨询适合您平台的最佳方法。
元标记语法:
<meta name="google-adsense-platform-author" content="{creator-username}">
其中的 {creator-username} 是在此网页上创作内容的用户的公开 ID。我们仅要求针对网址结构是网址中不显示创建者 ID 的网域使用此元标记。请参阅以下示例情形:
使用场景 |
网址结构 |
是否需要元标记 |
子网域 |
根:
https://littlepig.example.com
内容:
https://littlepig.example.com/food.html
|
否 |
子文件夹 |
根:
https://example.com/littlepig
内容:
https://example.com/littlepig/food.html
|
否 |
子网域和子文件夹的组合 |
根:
https://sites.example.com/sites/littlepig
内容:
https://sites.example.com/sites/littlepig/food.html
|
否 |
单个网址 |
根(或者创作者个人资料):
https://example.com/user/littlepig
内容:
https://example.com/nf8ag4n
|
否 |
根据上表中的示例网址,元标记应如下所示:
<meta name="google-adsense-platform-author" content="littlepig">
根据此元标记中的信息,我们会按照内容检查系统中所用的平台用户来细分网址。尽管上表中显示不需要此元标记,我们还是建议您使用。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
[null,null,[],[[["\u003cp\u003eMeta tags are used to optimize your platform for ad serving, including specifying platform account, sub-account, and platform author information.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egoogle-adsense-platform-account\u003c/code\u003e meta tag automatically adds the data-ad-host parameter to AdSense ad requests and contains your AdSense Publisher ID.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egoogle-adsense-account\u003c/code\u003e meta tag helps sub-accounts pass the ownership check during site verification and should be implemented based on consultation with your account manager.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egoogle-adsense-platform-author\u003c/code\u003e meta tag identifies the content creator and is used for content checking, and is recommended even if not strictly required based on URL structure.\u003c/p\u003e\n"]]],["Meta tags are used to scale ad serving. The `google-adsense-platform-account` tag adds the `data-ad-host` parameter to ad requests, using the AdSense publisher ID. The `google-adsense-account` tag, using a sub-account ID, aids in site verification. The `google-adsense-platform-author` tag, with the creator's public ID, segments URLs by platform users, primarily for content checking systems and it is recommended even when not required by the URL structure.\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\nFor the Direct model, this meta tag only has one purpose. It automatically adds the `data-ad-host` parameter to all AdSense ad requests from the page it exists on. It you're including the `data-ad-host` parameter in the ad codes, then this is redundant.\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### Sub account\n\nMeta tag syntax: \n\n \u003cmeta name=\"google-adsense-account\" content=\"{sub-account}\"\u003e\n\nWhere {sub-account} is the second publisher ID from the [Account name](/adsense/platforms/reference/rest/v1alpha/platforms.accounts) with \"ca-\" prepended to it. 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 sub 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 author\n\nMeta tag syntax: \n\n \u003cmeta name=\"google-adsense-platform-author\" content=\"{creator-username}\"\u003e\n\nWhere {creator-username} is the public ID of the person 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 | Is meta tag required? |\n|-------------------------------------------|---------------------------------------------------------------------------------------------------------------------|-----------------------|\n| Subdomains | Root: https://littlepig.example.com \u003cbr /\u003e Content: https://littlepig.example.com/food.html | No |\n| Sub folders | Root: https://example.com/littlepig \u003cbr /\u003e Content: https://example.com/littlepig/food.html | 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 | No |\n| Individual URLs | Root (or creator profile): https://example.com/user/littlepig \u003cbr /\u003e Content: https://example.com/nf8ag4n | No |\n\nThe meta tag based on the example URLs in the table above would look like this: \n\n \u003cmeta name=\"google-adsense-platform-author\" content=\"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."]]