Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

vue-adsense

1.0.1 • Public • Published

Google Adsense for Vue

npm version

vue-adsense

A simple Vue component for handling Google Ads

Installation

npm install --save-dev vue-adsense

and include the adsbygoogle.js file in your HTML

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

Usage

Import the component

import VueAdsense from 'vue-adsense'

Register the component

Vue.component('adsense', VueAdsense)

And put into your DOM

<adsense
  ad-client="ca-pub-xxxxxxxxxxxxxxxx"
  ad-slot="XXXXXXXX"
  ad-style="display: block"
  ad-format="auto">
</adsense>
</div>

Values

  • ad-client - Your Google Adsense publisher account
  • ad-slot - The desired ad ID
  • ad-style - Any special styling you want
  • ad-format - Provided by Google, is usually 'auto'

Notes

Contributions welcome, enjoy the component

install

npm i vue-adsense

Downloadsweekly downloads

167

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability