1.0.0 • Published 6 years ago

vue-ad-banners v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

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>