node.js - 如何在我的节点 js 项目中添加 google AdSense
问题描述
我使用node js、express和jade创建了一个网站。我想使用 google adsense 在我的网站上投放一些广告。
我创建了一个 Google AdSense 帐户,并被要求在头部标签之间放置一行代码 (1)。
因为我在我的网站上使用了翡翠,所以我将代码更改为对翡翠友好的代码(2)。
但是,Google Adsense 说它在我的网站中找不到代码。
我确信我的 URL 和脚本中没有拼写错误/语法错误。
请帮忙!
(1)。<script data-ad-client="ca-pub-1234123412341234" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
(2)。脚本(data-ad-client="ca-pub-1234123412341234" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js")
解决方案
据我所知,您只需要在属性之间添加逗号。
此外,在公共论坛上分享您的密钥可能不是一个好主意。
script(data-ad-client="ca-pub-1234123412341234", async, src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js")
推荐阅读
- jquery - 在 php 字符串中使用替换函数
- com - 如何让我的 WiX 产品脚本正确安装我的活动 x 控件?
- python - 一种用组有效地替换数组元素的算法
- angular - Nginx 重新加载 Angular 应用程序
- html - 如果空单元格更改行颜色,则html css表
- azure-devops - 如何使发布管道期间生成的文件可访问?
- python - 自动决定从python中的相关矩阵中删除哪个特征
- python - 将 var 值从 HTML 传递到 python
- html - 无论内容如何,如何使每个列标题具有相同大小的 flexbox 布局?
- xml - 将许可证文件复制到 bin/Release/Publish