Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/475.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Vue如何将adsense脚本注入头部_Javascript_Vue.js_Vuejs2 - Fatal编程技术网

Javascript Vue如何将adsense脚本注入头部

Javascript Vue如何将adsense脚本注入头部,javascript,vue.js,vuejs2,Javascript,Vue.js,Vuejs2,我想包括在我的网站上的adsense,但我必须包括这个脚本的头部 <script data-ad-client="ca-pub-XXXXXXXXXXX" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> 如何以编程方式将脚本注入头部 我可以将它添加到dist/的index.html中,但是我不会在git上跟

我想包括在我的网站上的adsense,但我必须包括这个脚本的头部

<script data-ad-client="ca-pub-XXXXXXXXXXX" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>


如何以编程方式将脚本注入头部

我可以将它添加到
dist/
的index.html中,但是我不会在git上跟踪
dist/

总有一天当我换电脑的时候,它会咬我的


如果使用默认的vue项目布局,通常会将其添加到
public/index.html
中https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js“添加后。但是谷歌证实他们找到了脚本…这正常吗?可能是你的adblocker/其他浏览器扩展阻止了请求?