Giter Site home page Giter Site logo

vue-google-ad-manager's Introduction

Google Ad Manager for Vue

Vue.js plugin to easy implement google ad units to your SPA

Currently in production on these sites

https://northplattepost.com

Installation

Install

npm install vue-google-ad-manager

or

yarn add vue-google-ad-manager

Import and use the plugin in your main.js or entry file You must pass in your network code and mappings. Sizes object is optional. Example below.

import AdManager from 'vue-google-ad-manager';

let mappings = {
	banner:[
		{ window :[0,0], sizes: [ [320,50] ] },
		{ window :[980,0], sizes: [ [720,60],[728,90] ] }
	],
	rectangle:[
		{ window: [0, 0], sizes: [ [300, 250] ] },
        { window: [980, 0], sizes: [ [300, 250] ] }
	]
}

let sizes = {
	banner: [ [720, 60],[728, 90],[320, 50] ],
	rectangle: [ [300, 250] ]
};

Vue.use(AdManager, {
    id: 'ad-manager-network-code',
	mappings,
	sizes //optional
});

Params

Title Description Type Required
mappings Mapping sizes object object true
sizes Google ad unit sizes object false

Use

Now you can use the google ad component throughout your application. There are a few params you can pass through for customization

<google-ad unit="AdUnitName"></google-ad>

Params

Title Description Type Required
unit Ad unit name from ad manager string true
id Div id tag - used to identify ads string false

Contributing

Pull requests welcomed!

vue-google-ad-manager's People

Contributors

garrettbland avatar mhatch-sc avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.