Render Ad creatives using setSafeFrameConfig in Google IMA

CK CK 3788 
Created at
Updated at  
1,078 0 0

SafeFrame is an API-capable iframe that provides a single, unified mechanism for communication between advertiser and publisher content. SafeFrame technology in Ad Manager provides transparent and rich interactions between page content and ads while preventing external access to sensitive data and providing more granular control over which creatives are rendered using the SafeFrame container with GPT (Google Publisher Tag).

IAB standards require publishers to update their websites to render ads inside SafeFrame containers. However, when using GPT tags, Ad Manager supports and automatically activates SafeFrame.

To minimize the chances of malicious creatives serving, we recommend activating SafeFrame whenever possible, in conjunction with the HTML5 sandbox attribute, to prevent top-level navigation. 

Render Ad creatives using setSafeFrameConfig in Google IMA

 


googletag.SafeFrameConfig

Below is a configuration object for SafeFrame containers

Property Summary
allowOverlayExpansion

Whether SafeFrame should allow ad content to expand by overlaying page content

allowPushExpansion

Whether SafeFrame should allow ad content to expand by pushing page content

sandbox

Whether SafeFrame should use the HTML5 sandbox attribute to prevent top-level navigation without user interaction

useUniqueDomain

Deprecated. Whether SafeFrame should use randomized subdomains for reservation creatives

 

setSafeFrameConfig example based on JavaScript

googletag.pubads().setForceSafeFrame(true);
 
const pageConfig = {
  allowOverlayExpansion: true,
  allowPushExpansion: true,
  sandbox: true,
};
 
const slotConfig = { allowOverlayExpansion: false };
 
googletag.pubads().setSafeFrameConfig(pageConfig);
 
// The following slot will not allow for expansion by overlay.
googletag
  .defineSlot("/1234567/sports", [160, 600], "div-1")
  .setSafeFrameConfig(slotConfig)
  .addService(googletag.pubads());
 
// The following slot will inherit the page level settings, and hence
// would allow for expansion by overlay.
googletag.defineSlot("/1234567/news", [160, 600], "div-2").addService(googletag.pubads());
 
googletag.display("div-1");
googletag.display("div-2");

 

Tags Ad Manager GPT GPT Tags Google IMA Google Publisher Tag HTML5 Safe Frame SafeFrame setSafeFrameConfig Facebook X
Comments 0
Similar posts
  1. SafeFrame is a web standard developed by IAB
    507
  1. Invalid Auction Storms in Ad Tech
    98
  2. Building MRC-Compliant Instrumentation in Ad Tech: Implementation Steps and Key Challenges
    202
  3. The Two Clocks of Ad Server Architecture
    70
  4. Collecting Proof-of-Play from 100,000 Screens
    146
  5. Extracting Context from Live Video: The Architecture Got Simpler When We Stopped Building Features
    256
  6. The New Ad Stack Behind Live Sports Streaming: Inside SGAI, EABN, and the Standards Race to Fix Live Monetization
    656
  7. IAS IP Blocklist: Causes, Resolution, and Detection Strategies
    190
  8. What Is UniversalAdId? The Complete Guide to VAST Video Ad Tracking
    198
  9. End-to-End Contextual Video Processing Architecture for AdTech
    207
  10. UCP for AVOD: Standardizing Ad Monetization
    345
  11. Advertiser Universal Commerce Protocol (UCP) Readiness Checklist
    443
  12. SEO is dying, AEO is coming
    1,215
  13. Conditional AdSense Script Loading in Confluence
    1,416
  14. Architecting ML/LLM Ad Targeting with Kafka, Flink, FAISS, and Milvus
    281
  15. What is VAST? What is VMAP? How VAST/VMAP works?
    896
  16. AWS Real-Time Dashboards: Druid, ClickHouse, or Lambda?
    623
  17. Ad Tech Multi-Tenancy: A Spectrum of Isolation Architectures on AWS
    331
  18. Attribution's New Blueprint: Balancing Performance and Privacy
    501
  19. Ad Auction Architectures: A Publisher's Guide to Optimal Monetization
    681
  20. Ad Pacing Unpacked: Architecting Guaranteed Delivery
    357
  21. Brand Safety: AI-Driven Content Moderation on AWS
    719
  22. The Future of Programmatic Advertising: Privacy-First Strategies and Trade-offs
    515
  23. Measuring Ad Viewability: AWS Architectures for Programmatic Accountability
    476
  24. AI-Powered Ad Fraud Detection: Architectural Strategies
    334
  25. AWS Ad Exchange Disaster Recovery: Active-Active, Active-Passive, and Cell Strategies - Disaster Recovery
    1,356
  26. Architecting Ad Tech's Terabyte Log Pipeline - Log Aggregation
    327
  27. Ad Tech Edge Architectures: Reducing Latency and Offloading Work - Edge Computing
    335
  28. Achieving Zero-Downtime Deployment for Stateful Ad Servers
    1,220
  29. Ad Tech Circuit Breakers: Architectures for Resilient Bidding Engines - Circuit Breaker
    353
  30. Balancing Real-Time Ad Stats and Billing Accuracy - Eventual vs Strong Consistency
    644
Recently updated
  1. Why 100% SEO Guarantees Better User Engagement and How to Achieve It in Your Service
    39
  2. Why SPF and DKIM Are Essential for Linux Email Servers?
    34
  3. How do I create animated background for Google Meet?
    20,611
  4. MaxMind GeoLite2 vs. DB-IP Lite vs. ip-api.com: Choosing the Right Free IP Geolocation Solution
    244
  5. Meet Valkey: Why Redis Changed Its License, Why Valkey is Better, and How to Use It as a Drop-in Replacement
    94
  6. How Rogue Web Scrapers Are Stealing My Content and Destroying My Server
    157
  7. Array of arguments passed to script in PHP
    90
  8. Invalid Auction Storms in Ad Tech
    98
  9. Building MRC-Compliant Instrumentation in Ad Tech: Implementation Steps and Key Challenges
    202
  10. The Two Clocks of Ad Server Architecture
    70
  11. Frequency Cap Architecture Overview
    514
  12. Collecting Proof-of-Play from 100,000 Screens
    146
  13. Vector Search in Relational Databases (RDBs): Trends & Usage Environments
    287
  14. What is RedisVL?
    109
  15. Designing a Skill Registry Architecture: Minimize Token Usage and Maximize AI Performance
    230
  16. TPU & GPU Cluster Management Tools
    243
  17. The Concept of Scaffolding in AI Agents
    233
  18. Beyond Static Pipelines: Architecting LLM Multi-Agent Systems for Autonomous Workflow Orchestration
    582
  19. AI-DLC vs. AI-SDLC: Model-Centric vs. System-Centric AI Development
    258
  20. Fine-Tuning Open-Weight LLMs: Training, Licensing, and Deploying Custom Models with Ollama
    338
  21. Inside the Next-Generation Streaming Architecture: Ultra-Low Latency, SGAI, and AI Codecs
    202
  22. Machine Learning: Training vs. Ranking
    221
  23. The Continuous Learning Machine: Designing a Loop That Actually Turns
    222
  24. The Next-Gen Low-Latency Standards: LL-HLS & MoQ
    195
  25. Designing a Data Curation System Around a Vector Database
    220
  26. Extracting Context from Live Video: The Architecture Got Simpler When We Stopped Building Features
    256
  27. The New Ad Stack Behind Live Sports Streaming: Inside SGAI, EABN, and the Standards Race to Fix Live Monetization
    656
  28. Designing MLOps Architectures to Handle Seasonal Data Drift in EV Fleet Models
    195
  29. From 15 to 40+ FPS: Accelerating PyTorch Object Detection on Automotive ECUs
    216
  30. Understanding Data Lineage
    260