AdSense for games (AFG)

Get the code for a video tag for AdSense for games

You can use the AdSense for games tag generator to easily create ad tags for your web-based gaming content.

Note: You can manually override any parameters in the tag that you generate, and also add optional parameters, to get your desired ad setup. For more information, see AdSense for games tag parameters for IMA3.
  1. Sign in to your AdSense account.
  2. Click Ads for Games.
  3. On the "Get code" page, enter a description URL for the video tag, such as The description URL is usually a site that points to where the ad tag and gaming content will serve.
  4. Select whether your video ad type is a "Standard instream" or a "Skippable" ad.

    You can assign a "Maximum duration" to the ad type you select.

  5. Decide on the overlay type. You can select from "Text" and/or "Image".
  6. Identify whether your video position is "Pre-roll", "Mid-roll", or "Post-roll".

    When you select the "Mid-roll" video position, you can specify a value in seconds.

  7. Select the video ad technology:
    • Direct SDK: If your ad setup is integrated with the Google IMA SDK.
    • IMA Adapter: If your ad setup is compliant with VAST and VPAID 2 JS standards.
  8. Copy and paste the generated code into your game (make sure that it complies with the AdSense for games policies).
    Sample 'Direct SDK' tag

    Sample 'IMA Adapter' tag

    Tip: You can now take the code generated, and put this in the ad setup for your web-based game. If you want to test your new ad code, try using our Video Suite Inspector.
Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue