Sometimes, ads on your homepage may not render correctly. One common reason is a DIV ID mismatch. The DIV ID is the unique identifier that links your ad slot in Google Ad Manager (GAM) with the ad code implemented on the site.
Step 1: DIV ID
- Every ad slot has a unique div id that tells the browser where to display the ad.
-
Example from ad code:
<div id='div-gpt-ad-1707890739030-0'></div> - Important: In most cases, the DIV ID is part of the custom code section of your Page Builder widget. It must match exactly with the one defined in GAM.
Step 2: Log in to Google Ad Manager (GAM)
- Open Google Ad Manager in your browser.
- Locate the Ad Unit
- In GAM, go to Inventory → Ad units.
- Search for the ad unit name, e.g., EDX_HOMEPAGE_300x250_MID.
- Open the ad unit details.
Check these points:
- Sizes: Should match the ad code (e.g., 300x250).
- Parent unit: Must be assigned under the homepage or main site section.
- Ad unit ID / code: The GPT DIV ID used in GAM should match the one in the Page Builder custom code.
Step 4: Check Line Items
- Go to Delivery → Orders in GAM.
- Open the order serving this ad unit and check the line items.
Verify:
- Targeting: Must include the homepage or all pages where the ad should appear.
- Creatives: 300x250 creatives are attached.
- Status: Should be Active, not paused
- Start & End Dates: Ensure the ad is currently scheduled to run.
Step 5: Verify the Widget in Page Builder
- Open Page Builder.
- Locate the widget containing your ad slot.
- Check the following:
- Custom Code / DIV ID: Ensure the DIV ID matches exactly with GAM.
- Lazy Load / Performance Settings: Temporarily disable to test if the ad renders immediately.
- Scripts: Ensure there are no conflicting GPT or DFP scripts.
Step 6: Test Ad Rendering on Homepage
- Open the homepage in your browser.
- Refresh the page normally (Ctrl+R / Cmd+R).
- Check if the ad appears immediately
If the ad only appears after a hard refresh:
- Recheck the DIV ID alignment.
- Adjust lazy load settings in Page Builder.
- Look for script conflicts or duplicate ad initialization.
Key Tips
- The DIV ID must be unique for every ad slot on the page.
- Always use the custom code section in Page Builder for GPT/DFP ad scripts.
-
Misaligned DIV IDs are the most common reason ads do not render correctly on initial page load.