Skip to content
  • There are no suggestions because the search field is empty.

Lazy loading with GAM

In this section we will walk you through Google Ad Manager lazy loading settings in HB Manager

Google AdManager lazy load 

In addition to our own lazy load function, we have added support for the more standardized, GAM's lazy load.

You can find the setting by going under the wanted Publisher account, and selecting the Prebid Parameters next to the website where you want to enable the GAM lazy load.

Find the section in
Prebid Parameter > Generic Prebid Config Data > GAM Lazy Load Settings.

Näyttökuva 2023-12-20 kello 15.37.11

Google Ad Manager (GAM) uses viewport-based lazy loading to ensure that ads are only loaded when they are likely to be seen. This improves page load speed and user experience by prioritizing content over below-the-fold ads.

1. Fetch Margin

The Fetch Margin determines when the ad request is sent to the server.

  • What it does: It tells the browser, "Go get the ad data from GAM now."

  • The Math: This value is a percentage of the viewport height.

  • Example: A value of 500 represents 500% (or 5 viewports). If the user is 5 screen-lengths away from the ad slot, the fetch process begins.

  • Why it matters: Fetching is usually set higher than rendering to account for network latency, ensuring the "creative" is ready before the user arrives.

 

2. Render Margin

The Render Margin determines when the ad is actually displayed on the page.

  • What it does: It triggers the browser to draw the ad and insert it into the DOM.

  • The Math: Also a percentage of the viewport height.

  • Example: A value of 200 (2 viewports) means the ad won't actually appear until the user is significantly closer to the slot.

  • Why it matters: Postponing the render saves the user’s device CPU and memory. It also ensures that the "Impression" is tracked as close to the actual view as possible.

 

3. Mobile Multiplier

Mobile users typically scroll faster than desktop users, but mobile networks can be less stable. To account for this, GAM provides a Mobile Multiplier.

  • How it works: This is a scaling factor applied to both the Fetch and Render margins specifically for mobile devices.

  • The Logic: If your Desktop Fetch Margin is 200 and your Mobile Multiplier is 2.0, the effective Fetch Margin on mobile becomes 400.

  • The Goal: By doubling the margin on mobile, you start the ad process even earlier, giving the ad more time to load before a fast-scrolling mobile user reaches the slot.

 

Feature Unit Purpose
Fetch Margin % of Viewport When to call the server for an ad.
Render Margin % of Viewport When to display the ad in the browser.
Mobile Multiplier Scalar (x) Increases margins on mobile to offset fast scrolling.


NOTE: 
Whereas with our lazy load function you can adjust the lazy load per placement, GAM's lazy loading applies only on a site level and should be adjusted under the site level parameters.

However, you can utilise both technologies side-by-side if needed. Basically there is no priority, but the "laziest" will win.