我将配置 Google Adsense 添加到我的nuxt.config.js文件中:
head: {
...
script: [
{
src: 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js',
'data-ad-client': process.env.VUE_APP_GA_AD || '',
async: true,
},
],
},
我有一个错误:
adsbygoogle.push() 错误:每个页面仅支持一个 AdSense 头部标签。第二个标签被忽略。
和警告:
AdSense 头部标记不支持 data-n-head 属性。
在页面的源代码中,我可以看到添加到 head 标签的代码:
<head>
...
<script data-n-head="ssr" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js" data-ad-client="ca-pub-MY_NUMBER" async>
...
</head>
我该如何解决?