Mobile app version of vmapp.org
Login or Join
Candy875

: Google DFP - Responsive ads don't render I have https://www.iq-mag.net/dfp.php and it doesn't seem to work - by that I mean no ads are loading at all I checked the console and am getting the

@Candy875

Posted in: #GoogleDfp #Javascript

I have www.iq-mag.net/dfp.php and it doesn't seem to work - by that I mean no ads are loading at all

I checked the console and am getting the following in Chrome and Firefox on Windows 10:

GET www.googletagservices.com/tag/js/gpt.js net::ERR_CONNECTION_REFUSED


Beyond that - does anything look particularly wrong with the code?

<html>
<head>
<title>GPT Training - Responsive Test Page</title>
<script async src="https://www.googletagservices.com/tag/js/gpt.js"></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
</script>
<script>

// GPT slots
var gptAdSlots = [];
googletag.cmd.push(function() {

// Define a size mapping object. The first parameter to addSize is
// a viewport size, while the second is a list of allowed ad sizes.
var mapping = googletag.sizeMapping().

// Everything else
addSize([0, 0], [[349, 456], [198,241]]).

// Less than a desktop
addSize([750, 200], [[349, 456], [198,241]]).

// Desktop
addSize([1050, 200], [[900, 200], [1024, 200]]).build();

// Define the GPT slot
gptAdSlots[0] = googletag.defineSlot('/210178423/Desktop_Leaderboard', [349, 456], 'leaderboard').
defineSizeMapping(mapping).
addService(googletag.pubads());

gptAdSlots[1] = googletag.defineSlot('/210178423/MPU', [198, 241], 'mpu').
defineSizeMapping(mapping).
addService(googletag.pubads());

// Start ad fetching
googletag.enableServices();
});
</script>
</head>
<body>
<h1>Leaderboard</h1>
<script>
googletag.cmd.push(function() {
googletag.display('leaderboard');
});
</script>
<h1>MPU</h1>
<script>
googletag.cmd.push(function() {
googletag.display('mpu');
});
</script>
</body>
</html>



I have 4 ad units (Desktop Leaderboard, Desktop MPU, Desktop Sidebar, Desktop MPU)
I have two placements (Top, Side)
I have line items in all 4 ad units


Am I doing anything drastically wrong?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Candy875

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme