简体   繁体   English

没有数据广告位 google adsense vue

[英]no data-ad-slot google adsense vue

I want to put google adsense commercial on my website which i built with vuejs.我想在我用 vuejs 构建的网站上投放 google adsense 广告。 The idea was to use "vue-google-adsense" to show the commercial.这个想法是使用“vue-google-adsense”来展示广告。

After I had a look at the VueAdsense Template, I figured that my code, provided by google, does not have any "data-ad-slot" (see picture below).在查看了 VueAdsense 模板后,我发现我的代码由 google 提供,没有任何“数据广告槽”(见下图)。 I installed already "vue-google-adsense" and put the data as mentioned in the docu in my app but without the " data-ad-slot="1234567890" " line.我已经安装了“vue-google-adsense”并将文档中提到的数据放在我的应用程序中,但没有“data-ad-slot="1234567890"”行。 My configuration in my vue file (where I want to display the ad) looks like the following:我在我的 vue 文件中的配置(我想在其中显示广告)如下所示:

main.js main.js

...
import Ads from 'vue-google-adsense'
Vue.use(require('vue-script2'))
Vue.use(Ads.Adsense)
...

showdata.vue (where I want to display the commercial) showdata.vue(我想展示广告的地方)

<template>
  <v-container>
    ...
      <Adsense
        data-ad-client="ca-pub-XXXXXXXXXXXXXXXX"
      </Adsense>
    ...
  </v-container>
</template>

The problem I'm facing is that google does not find the commercial on my website.我面临的问题是谷歌在我的网站上找不到广告。 When I click "I've pasted the code into my site" (see picture) and confirm that with "Done", google doesn't find my commercial.当我点击“我已将代码粘贴到我的网站”(见图)并通过“完成”确认时,谷歌没有找到我的广告。

Do I do something wrong or do I miss anything?我做错了什么还是错过了什么?

Does anybody know why I don't have this data-ad-slot?有人知道为什么我没有这个数据广告位吗?

Cheers干杯在此处输入图像描述

Ok,好的,

my mistake.我的错。 You first need to put the script shown in the picture above in your normal html code (for vue it would be the index.html after npm run build).您首先需要将上图中显示的脚本放入您的正常 html 代码中(对于 vue,它将是 npm 运行构建后的 index.html)。

Then google checks and afterwards you get all the information you need;)然后谷歌检查,然后你得到你需要的所有信息;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM