Add support for Companion Ads

Created on 23 October 2013, almost 12 years ago
Updated 20 July 2025, 8 days ago

I need to add support for companion ads. This is the relevant portions from a snippet my client gave me.

googletag.defineSlot('/12345/abcdef', [300, 250], 'div-gpt-ad-1382134010999-4').addService(googletag.companionAds()).addService(googletag.pubads());

googletag.companionAds().setRefreshUnfilledSlots(true);
googletag.pubads().enableVideoAds();

I know I can achieve part of this by pasting the last two lines into the 'dfp_injected_js' setting, but the first line modifies the defineSlot code and adds an "addService(googletag.companionAds())" on a per-tag basis.

✨ Feature request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States jojonaloha

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024