首页 > 解决方案 > 如何在我的节点 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")

标签: node.jsexpresspugadsense

解决方案


据我所知,您只需要在属性之间添加逗号。

此外,在公共论坛上分享您的密钥可能不是一个好主意。

script(data-ad-client="ca-pub-1234123412341234", async, src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js")

推荐阅读