> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://helpdesk.ezmob.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# 如何在 Blogger 的 <head> 部分添加广告代码

将 EZmob 代码粘贴到 Blogger 主题中 `</head>` 的正上方。注意：blogspot.com 地址无法验证。只有使用自定义域名的 Blogger 博客才能通过验证并获得优质需求。

## 开始之前

- 如需验证，请为博客绑定自定义域名。您仍可添加 blogspot.com 网站并创建广告位，但该网站无法通过验证。
- 请先在 EZmob 中添加网站。请参阅 [如何将网站添加到 EZmob 进行变现](https://helpdesk.ezmob.com/zh/article/how-to-add-your-site-to-ezmob-for-monetization-10hgtet/)。

## 复制广告代码

1. 在 EZmob 控制面板中，打开 **网站与投放** → **您的投放**。
2. 点击该广告位上的代码图标（**查看脚本**）。
3. 点击 **复制脚本**。

## 将代码添加到 `<head>` 部分

1. 在 Blogger 中打开 **主题**（Theme）。
2. 点击 **自定义**（Customize）旁边的箭头，然后选择 **修改 HTML**（Edit HTML）。
3. 点击编辑器内部，按 **Ctrl + F**（Mac 上为 **Cmd + F**），搜索 `</head>`。
4. 将代码粘贴到 `</head>` 正上方的一行。
5. 点击 **保存**（Save）。

按照相同步骤添加网站的 **验证代码**，然后在 EZmob 中点击 **验证**。

## 头部竞价横幅

头部竞价代码以 `<div id="container1"></div>` 结尾，用于标记横幅的展示位置。

1. 按上述方法，将不含该 `<div>` 的代码粘贴到 `</head>` 上方。
2. 在 Blogger 中打开 **布局**（Layout），在侧边栏区域点击 **添加小工具**（Add a Gadget）。
3. 选择 **HTML/JavaScript**，将 `<div id="container1"></div>` 粘贴到内容字段中，然后点击 **保存**。

## 注意事项

- 如果您更换或重置了主题，请重新添加代码。
- 请在关闭广告拦截器的无痕窗口中测试您的博客。

## 截图

- *截图：Blogger 主题，“自定义”菜单中突出显示“修改 HTML”*
- *截图：Blogger HTML 编辑器，代码已粘贴到 </head> 上方*

## 相关文章

- [如何创建广告位并获取广告标签](https://helpdesk.ezmob.com/zh/article/how-to-create-a-placement-and-obtain-your-ad-tag-1jjrdjs/)
- [如何将网站添加到 EZmob 进行变现](https://helpdesk.ezmob.com/zh/article/how-to-add-your-site-to-ezmob-for-monetization-10hgtet/)
- [通过 EZmob 头部竞价（Header Bidding）实现变现](https://helpdesk.ezmob.com/zh/article/header-bidding-monetization-with-ezmob-17ooltx/)
- [如何在 WordPress 的 <head> 中添加广告代码](https://helpdesk.ezmob.com/zh/article/how-to-add-an-ad-tag-to-head-section-in-wordpress-1rxwkoz/)