{"id":15061046,"url":"https://github.com/ad4game/phaser-a4g","last_synced_at":"2025-06-30T21:09:00.807Z","repository":{"id":57094531,"uuid":"87322377","full_name":"ad4game/phaser-a4g","owner":"ad4game","description":"Phaser plugin allowing Video and HTML5 ad integrations with phaser.io games","archived":false,"fork":false,"pushed_at":"2017-08-10T14:41:08.000Z","size":902,"stargazers_count":16,"open_issues_count":0,"forks_count":3,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-06-10T11:45:00.653Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ad4game.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-05T14:55:57.000Z","updated_at":"2022-12-28T18:01:22.000Z","dependencies_parsed_at":"2022-08-22T22:01:02.160Z","dependency_job_id":null,"html_url":"https://github.com/ad4game/phaser-a4g","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ad4game/phaser-a4g","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad4game%2Fphaser-a4g","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad4game%2Fphaser-a4g/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad4game%2Fphaser-a4g/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad4game%2Fphaser-a4g/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ad4game","download_url":"https://codeload.github.com/ad4game/phaser-a4g/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ad4game%2Fphaser-a4g/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261110282,"owners_count":23111013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T23:08:33.750Z","updated_at":"2025-06-30T21:09:00.782Z","avatar_url":"https://github.com/ad4game.png","language":"JavaScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"This is a Phaser HTML5 framework plugin to integrate both Google Adx and A4G video pre-roll ads into your HTML5 games.\n\nWhy we've created it and the target audience:\n* We love games, especially the HTML5 flavour.\n* We have created this plugin to help our existing and future customers monetise their Phaser games.\n* All of our HTML5 publishers, who tried video pre-roll, generated higher revenues.\n* Why AdX and not Adsense? Adx is paid by CPM and should generate better profits.\n\nA4G Demo usage\n================\n\nThe game from this github repository shows how a video pre-roll ad can be integrated into HTML5 framework Phaser game. \nSee a working demo showing a video pre-roll and inter-game ad each 60 seconds: http://xmmorpg.com/phaser-a4g/example/\n\nIntegration steps:\n* First include `a4g-ad-plugin.js` into your codebase.\n* Then create the A4gPlugin:\n\n```\ngame.a4gPlugin = game.plugins.add(A4gPlugin.configure({\n        zone: YOUR_ZONE_ID\n    }));\n```\n* Whenever you want to show an ad within your game just call `showAd()` function. \nTypically game developers call this function on the beginning of the game and between the levels. \n\n```\ngame.a4gPlugin.onAdComplete.add(function () {\n        console.log('Ad has been completed');\n    });\n    \ngame.a4gPlugin.showAd();\n\n```\n\nIn 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.\n\nNote: Adx has rigorous requirements to join. We will help you with the set-up process to make it as smooth as possible.\n\nNPM\n=====================\n\nYou can get the latest NPM from here: https://www.npmjs.com/package/@ad4game/phaser-a4g\n```\nnpm install @ad4game/phaser-a4g --save-dev\n```\n\nA4g Phaser Plugin API\n=====================\n\n* `A4gPlugin.configure(config)` creates preconfigured A4gPhaser plugin. It takes 1 parameter, configuration.\nConfiguration is a regular JavaScript object, which can take following settings:\n  * `zone` zone id from A4g (required)\n  * `adTypes` array of ad types that can be displayed. Available values are `['video', 'skippablevideo', 'standardvideo', 'bumpervideo', 'text', 'image']`, default value is `['video']` which is equivalent to [`standardvideo', 'bumpervideo', 'skippablevideo`], see required params / ad_type for more info: https://support.google.com/adsense/answer/3112148\n  * `skipOffset` number of seconds when ad can be skipped, default value is `10`\n  * `fallbackZone` zone id which could be used in case the video cannot be loaded, by default not set. In case the Adx ad will not be loaded we will load a replacement ad (usually with a lower CPM). This could be useful if Adx fills a very small percentage of requests.\n  * `pauseGame` boolean indicates if game should be paused while ad is shown, default value is true\n  * `unpauseGameDelay` number of milliseconds to wait for unpausing game after ad is hidden (will be used only if `pauseGame` set to true), default value is 500 \n* `A4gPlugin.prototype.showAd()` shows an ad\n* `A4gPlugin.prototype.onAdShown` `Phaser.Signal` would be triggered when ad shown\n* `A4gPlugin.prototype.onAdComplete` `Phaser.Signal` would be triggered when ad showing is completed\n* You can fully control the styling of the div showing the ad. Our publishers often display games in an iframe, which autoscales to 100%.\n\nReferences:\n* http://phaser.io/\n* https://github.com/photonstorm/phaser\n* http://phaser.io/news/2017/05/a4g-plugin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad4game%2Fphaser-a4g","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fad4game%2Fphaser-a4g","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fad4game%2Fphaser-a4g/lists"}