A set of constants for enabling VPAID functionality.
Enumerations
CompanionBackfillMode
CompanionBackfillMode
Defines a set of constants for the companion backfill setting. This setting indicates
whether companions should be backfilled in various scenarios.
If the value is ALWAYS, companion backfill will be attempted in all
situations, even when there is no main ad returned.
If the value is ON_MASTER_AD, companion backfill will be attempted if
there is a main ad with fewer companions than there are companion slots. The missing
companions will be backfilled.
The default value is ALWAYS.
Note that client-side companion backfill requires tagging your companions properly with
a Google Publisher Tag (GPT). To enable backfill, the following changes to standard GPT
setup are necessary:
For autoplay videos, the following additional change is recommended to prevent companion
slots from being preloaded and then immediately replaced with companions.
A set of constants for enabling VPAID functionality.
Enumeration Members
DISABLED
VPAID ads will not play and an error will be returned.
ENABLED
VPAID ads are enabled using a cross domain iframe. The VPAID ad cannot access
the site. VPAID ads that depend on friendly iframe access may error. This is
the default.
INSECURE
VPAID ads are enabled using a friendly iframe. This allows the ad access to
the site through JavaScript.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-01-17 UTC."],[[["\u003cp\u003eThe documentation defines two key enumerations: \u003ccode\u003eCompanionBackfillMode\u003c/code\u003e and \u003ccode\u003eVpaidMode\u003c/code\u003e, both related to ad settings.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCompanionBackfillMode\u003c/code\u003e controls whether companion ads are backfilled, offering options for \u003ccode\u003eALWAYS\u003c/code\u003e backfilling or only \u003ccode\u003eON_MASTER_AD\u003c/code\u003e when there are missing companion ads compared to slots.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eVpaidMode\u003c/code\u003e determines how VPAID ads are handled, with options for \u003ccode\u003eDISABLED\u003c/code\u003e, \u003ccode\u003eENABLED\u003c/code\u003e using a cross-domain iframe, or \u003ccode\u003eINSECURE\u003c/code\u003e with a friendly iframe that provides the ad with access to the site.\u003c/p\u003e\n"],["\u003cp\u003eClient-side companion backfill requires specific Google Publisher Tag (GPT) setup, including enabling \u003ccode\u003egoogletag.companionAds()\u003c/code\u003e and setting \u003ccode\u003esetRefreshUnfilledSlots(true)\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Namespace ImaSdkSettings\n\n| **Note:** This reference page follows TypeScript documentation structure. If you have suggestions for or see issues with the reference documentation, open a thread with your feedback on the [IMA technical forum](https://groups.google.com/g/ima-sdk/).\n\n*** ** * ** ***\n\n| Enumerations ||\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|\n| [CompanionBackfillMode](/interactive-media-ads/docs/sdks/html5/client-side/reference/namespace/google.ima.ImaSdkSettings#google.ima.ImaSdkSettings.CompanionBackfillMode) | Defines a set of constants for the companion backfill setting. |\n| [VpaidMode](/interactive-media-ads/docs/sdks/html5/client-side/reference/namespace/google.ima.ImaSdkSettings#google.ima.ImaSdkSettings.VpaidMode) | A set of constants for enabling VPAID functionality. |\n\nEnumerations\n------------\n\n*** ** * ** ***\n\n### CompanionBackfillMode\n\nCompanionBackfillMode\nDefines a set of constants for the companion backfill setting. This setting indicates whether companions should be backfilled in various scenarios. \n\n\nIf the value is `ALWAYS`, companion backfill will be attempted in all\nsituations, even when there is no main ad returned.\n\n\nIf the value is `ON_MASTER_AD`, companion backfill will be attempted if\nthere is a main ad with fewer companions than there are companion slots. The missing\ncompanions will be backfilled.\n\nThe default value is `ALWAYS`.\nNote that client-side companion backfill requires tagging your companions properly with a Google Publisher Tag (GPT). To enable backfill, the following changes to standard GPT setup are necessary: \n\n```\n ... let slot1 = googletag.defineSlot('/1234/adunit', [300, 250], 'slot-div'); slot1.addService(googletag.companionAds()).addService(googletag.pubads()); ... googletag.companionAds().setRefreshUnfilledSlots(true); ... googletag.enableServices(); \n```\nFor autoplay videos, the following additional change is recommended to prevent companion slots from being preloaded and then immediately replaced with companions. \n\n```\n googletag.pubads().disableInitialLoad(); ... googletag.enableServices(); \n```\n\n| Enumeration Members ||\n|--------------|---|\n| ALWAYS | |\n| ON_MASTER_AD | |\n\n*** ** * ** ***\n\n### VpaidMode\n\nVpaidMode\nA set of constants for enabling VPAID functionality.\n\n| Enumeration Members ||\n|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| DISABLED | VPAID ads will not play and an error will be returned. |\n| ENABLED | VPAID ads are enabled using a cross domain iframe. The VPAID ad cannot access the site. VPAID ads that depend on friendly iframe access may error. This is the default. |\n| INSECURE | VPAID ads are enabled using a friendly iframe. This allows the ad access to the site through JavaScript. |"]]