Easily add Google’s DoubleClick ads in your HTML5 games with a little Phaser plugin

When you create an HTML5 game, sooner or later you will want to monetize it.

If you plan to add ads, it can be quite a pain since there isn’t that much information around the web about HTML5 content and ads.

DoubleClick network seems to be a good choice and there are good news because Orange Games developed a plugin for providing nice ads integration in your Phaser games, have a look at this example:

You may have to reload the iframe to see it back in action.

You can find all the required docs in the official GitHub page, anyway here is the core of the integration:

Let me explain highlighted lines:

Line 45: the game itself.

Line 46: the id of game container.

Line 47: the id of ad container.

Line 48: the tag of your video ad. It’s not that easy to generate a working tag for video ads, so let me know if you need a tutorial about it.

I think I’ll try this service in a game I am about to publish.

  • Hi Emanuel

    Thank you for this post! Could you please tell me where I can sign up for double click.

    Also, is this different from Google Adsense? (which you’re not allowed to put inside games).

    Thank you!

    • Emanuele Feronato

      https://www.google.com/dfp – and I am trying to (legally) place a banner inside a game, stay tuned.

      • Cool, thank you for your reply :)

      • Are we sure that Google Doubleclick just for mobile games ?
        Also there are limits for free monthly impressions or fees .

      • James Tan

        Hi Emanuele,

        Have you found a solution to place banner inside a game? (similar to AFG ads)


  • Maxi

    Hi Emanuele,

    thanks for the tutorials.
    I need put ads in my HTML5 games but how can create an account in DoubleClick and get the tag for video ads to show ads in my games?


    • Emanuele Feronato

      https://www.google.com/dfp but AFAIK you need to sell ads on your own if you want to use the self generated tag.

      • Maxi

        How can create a tag video to monetize my game? I have an account, but is very confuse create ads and get money hehe

  • That’s a great tutorial Emanuele. Thanks for that !

  • ozgur

    more tutorials are on the way, right?

    • Emanuele Feronato


  • Frederik

    Interesting plugin, excited to try it out – especially for the browser version of my new unreleased Phaser game. But a follow-up tutorial on how to generate a valid video ad tag for both desktop and mobile web with DoubleClick for Publishers would be very helpful. There are so many parameters in a video tag, but some of them are automatically added by the IMA SDK, or how?

  • Hello how to generate video or game tag in DFP?

  • Peter Brezky Brezovan

    Hi. You are right. It is not easy to generate working tag for video ads indeed. So can you help me with that?