为简洁起见,本指南将使用自闭合标签(
而非 )。大多数
JSX及其他现代编译器均支持此语法。但是,如果您在纯
HTML中编写代码,则需要手动闭合标签。 This guide will use self closing tags
(
<script /> instead of <script></script>) for simplicity. Most JSX and other
modern compilers will accept this syntax. However, if you are working in raw
HTML, you should manually close the tags.添加Rev脚本 Add the Rev script
了解如何将我们的脚本添加到您的网站。 Learn how to add our script to your site.Using HTML
Using HTML
将以下脚本添加到 HTML 文件的
<head> 标签中。
Add the following script to the <head> of your HTML file.page.html
Using JS
Using JS
添加以下代码
Add the following code
index.js
您也可以考虑为脚本标签添加
defer属性,以优化页面初始加载速度。 You may also
consider adding the defer attribute to the script tag to optimize initial
page load speed.(Advanced) A/B testing with the script
(Advanced) A/B testing with the script
如需针对不同用户测试其他变现服务商,可使用以下代码按条件加载 Rev 脚本。
If wanting to test with another monetization provider per client, you can use
the following code to conditionally load the Rev script.
index.js
开发模式 Development
为脚本添加dev属性,以启用开发环境广告位。
Add the dev attribute to the script to use dev placements.
Using HTML
Using HTML
将以下脚本添加到 HTML 文件的
<head> 标签中。
Add the following script to the <head> of your HTML file.page.html
Using JS
Using JS
添加以下代码
Add the following code
index.js
定义广告单元 Defining ad units
为元素添加data-ad属性并填写广告位名称,以标记您希望广告出现的位置。
Add the data-ad attribute with the name of the placement to mark where you
want ads to appear.
(Advanced) Customizing ad units
(Advanced) Customizing ad units