vue-ad-banners
v1.0.0
Published
Google AdSense component for Vue.js
Downloads
5
Maintainers
Readme
Google AdSense component for Vue
Right now there's only one supported system: Google AdSense. I'll add some other ad systems later (or on demand).
Installation
npm install --save-dev vue-ad-banners
Don't forget to include the
adsbygoogle.js
file in your HTML!
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
Google AdSense
Import the component:
import { BannerAdsense } from 'vue-ad-banners';
Register the component:
// Globally:
Vue.component('banner-adsense', BannerAdsense);
// Or locally:
new Vue({
...
components: {
BannerAdsense,
},
...
});
And put into your DOM:
<banner-adsense
ad-client="ca-pub-xxxxxxxx"
ad-slot="XXXXXX"
ad-format="auto">
</banner-adsense>