Home

Awesome

This is a Phaser HTML5 framework plugin to integrate both Google Adx and A4G video pre-roll ads into your HTML5 games.

Why we've created it and the target audience:

A4G Demo usage

The game from this github repository shows how a video pre-roll ad can be integrated into HTML5 framework Phaser game. See a working demo showing a video pre-roll and inter-game ad each 60 seconds: http://xmmorpg.com/phaser-a4g/example/

Integration steps:

game.a4gPlugin = game.plugins.add(A4gPlugin.configure({
        zone: YOUR_ZONE_ID
    }));
game.a4gPlugin.onAdComplete.add(function () {
        console.log('Ad has been completed');
    });
    
game.a4gPlugin.showAd();

In order to integrate this plugin you will need YOUR_ZONE_ID. Unless you are an existing customer, please sign-up as a publisher / website at: http://www.a4g.com/#get-contacted and add a message saying that you are signing up for a Phaser HTML5 game.

Note: Adx has rigorous requirements to join. We will help you with the set-up process to make it as smooth as possible.

NPM

You can get the latest NPM from here: https://www.npmjs.com/package/@ad4game/phaser-a4g

npm install @ad4game/phaser-a4g --save-dev

A4g Phaser Plugin API

References: