Please make sure to visit Your AdSense Page where you can find personalized information about your account to help you succeed with AdSense.

AdSense for video (AFV)

Get the code for a video tag for AdSense for video

You can use the AdSense for video tag generator to quickly and easily create video ad tags for your videos.

Note: You can manually override all values in the tag that you generate. For more information, see AdSense for video tag parameters for IMA.
  1. Sign in to your AdSense account.
  2. Click Ads for Video.
  3. On the "Get code" page, enter a description URL for the video tag, such as
  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 selected.

  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 video (make sure that it complies with the AdSense for video policies).
    Sample 'Direct SDK' tag

    Sample 'IMA Adapter' tag

    Tip: If you want to test your ad code, you can use the Video Suite Inspector on the Google Developers site.

Was this helpful?

How can we improve it?
Clear search
Close search
Google apps
Main menu