GPT Ads - refresh fails when using lazy load - google-dfp

I'm trying to use the newly introduced googletag.PubAdsService.enableLazyLoad option with DFP ads. It works fine during the initial page load, but when I try to refresh ads on the page, I'm getting the following error:
Exception in queued GPT command TypeError: Cannot read property 'unobserve' of null
at Nt (pubads_impl_242.js:1)
at pubads_impl_242.js:1
at Object._.y (pubads_impl_242.js:1)
at Wt (pubads_impl_242.js:1)
at pubads_impl_242.js:1
at Vt (pubads_impl_242.js:1)
at _.V.$a (pubads_impl_242.js:1)
at Xu (pubads_impl_242.js:1)
at Cv (pubads_impl_242.js:1)
at wv._.h.refresh (pubads_impl_242.js:1)
Here is my code:
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.slots = googletag.slots || {};
var mapping = googletag.sizeMapping()
.addSize([0, 0], [1000, 1])
.addSize([320, 0], [[320, 50], [300, 50]])
.addSize([1025, 0], [970, 90])
.build();
googletag.slots["push"] = googletag.defineSlot("/1234/sample/", [[970, 90], [320, 50], [300, 50]], "dfp-ad-banner")
.addService(googletag.pubads())
.setTargeting("pos", "banner")
.defineSizeMapping(mapping);
googletag.cmd.push(function() {
googletag.pubads().enableAsyncRendering();
googletag.pubads().collapseEmptyDivs();
googletag.pubads().disableInitialLoad();
googletag.pubads().enableLazyLoad({fetchMarginPercent: 200,renderMarginPercent: 100,mobileScaling: 2.0});
});
googletag.enableServices();
...
googletag.cmd.push(function() {
googletag.display("dfp-ad-banner");
});
...
googletag.cmd.push(function () {
// add visibility helper classes
googletag.pubads().addEventListener('slotRenderEnded', function (event) {
var adClass = (event.size[0] > 1 && event.size[1] > 1) ? 'ad-visible' : 'ad-invisible';
$('#' + event.slot.getSlotElementId()).addClass(adClass);
});
// load ads
googletag.pubads().refresh(null, {changeCorrelator: false});
});

this is because the collapseEmptyDivs so far is not compatible with enableLazyLoad. I recommend removing collapseEmptyDivs.
Read more about this here https://developers.google.com/doubleclick-gpt/reference#googletag.PubAdsService_enableLazyLoad

The issue with refresh and destroy should be fixed now. Consider sending feedback from the developer reference page if you run into issues like this in the future.
https://developers.google.com/doubleclick-gpt/reference

Related

i am working on google bar charts, i am stuck with adding colours to individual bars

<!DOCTYPE html>
<html lang="en-US">
<body>
<h1>My Web Page</h1>
<div id="piechart"></div>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
// Load google charts
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
// Draw the chart and set the chart values
var a = [['Work', 8], ['Eat', 2], ['TV', 4], ['Gym', 2], ['Sleep', 8], ['walk', 2], ['games', 2], ['chess', 2], ['drink', 4], ['dance', 6]];
a.sort(compareSecondColumn);
function compareSecondColumn(a, b) {
if (a[1] === b[1]) {
return 0;
}
else {
return (a[1] > b[1]) ? -1 : 1;
}
}
// Draw the chart and set the chart values
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],a[0],a[1],a[2],a[3],a[4]
]);
// Optional; add a title and set the width and height of the chart
var options = { 'title': 'the title', 'width': 550, 'height': 400 };
// Display the chart inside the <div> element with id="piechart"
var chart = new google.visualization.ColumnChart(document.getElementById('piechart'));
chart.draw(data, options);
}
</script>
</body>
</html>
i am using bar chart, it only display default blue color.
i have used an array which removes the column which doesnot have data(like 0)
like sorting the data
i want to display individual color for each column
like red, green any different colors for each bar
i like to add annotations also
thanks in advance
the column headings and values posted in the above comments seem to work fine here...
the only changes made...
add type property to style and annotation roles.
added different colors for style role.
see following working snippet...
var a = [['Work', 8, "#E53935", 8], ['Eat', 2, "#1E88E5", 2], ['TV', 4, "#43A047", 4]];
a.sort(compareSecondColumn);
function compareSecondColumn(a, b) {
if (a[1] === b[1]) {
return 0;
}
else {
return (a[1] > b[1]) ? -1 : 1;
}
}
google.charts.load('current', {
packages: ['corechart']
}).then(function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day', {role: 'style', type: 'string'}, {role: 'annotation', type: 'number'}],a[0],a[1],a[2]
]);
var options = {
title: 'the title',
width: 550,
height: 400,
legend: 'none'
};
var chart = new google.visualization.ColumnChart(document.getElementById('piechart'));
chart.draw(data, options);
});
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="piechart"></div>

GeoCharts how to show country names instead of codes

I would like to make a visualization with the google GeoChart. I put in country codes. I would like to display the full country names but only the country code pops up.
google.charts.load('current', {
'packages': ['geochart'],
'mapsApiKey': 'AIzaSyD-9tSrke72PouQMnMX-a7eZSW0jkFMBWY'
});
google.charts.setOnLoadCallback(drawRegionsMap);
function drawRegionsMap() {
var data = google.visualization.arrayToDataTable([
['Country', 'Members'],
['LB', 3],
['JO', 2],
['IT', 24],
['PS', 3],
['LY', 1],
['TN', 6],
['LB', 3],
['EG', 2],
]);
var options = {
colorAxis: {
colors: ['#c1c1cd', '#53556e']
},
legend: 'none'
};
var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
chart.draw(data, options);
}
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<div id="regions_div" style="width: 900px; height: 500px;"></div>
using object notation,
you can provide the value (v:) and the formatted value (f:)
{v: 'IT', f: 'Italy'}
the tooltip will display the formatted value by default
update the data using object notation and provide the name as the formatted value
see following working snippet,
hover over Italy to see the result...
google.charts.load('current', {
'packages': ['geochart'],
'mapsApiKey': 'AIzaSyD-9tSrke72PouQMnMX-a7eZSW0jkFMBWY'
});
google.charts.setOnLoadCallback(drawRegionsMap);
function drawRegionsMap() {
var data = google.visualization.arrayToDataTable([
['Country', 'Members'],
['LB', 3],
['JO', 2],
[{v: 'IT', f: 'Italy'}, 24],
['PS', 3],
['LY', 1],
['TN', 6],
['LB', 3],
['EG', 2],
]);
var options = {
colorAxis: {
colors: ['#c1c1cd', '#53556e']
},
legend: 'none'
};
var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
chart.draw(data, options);
}
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<div id="regions_div" style="width: 900px; height: 500px;"></div>
Based on the WhiteHat's answer I added some code to automatize the introduction of the formatted values.
// iso to name conversion
// https://gist.github.com/maephisto/9228207
var isoCountries = {
'IT': 'Italy',
'JO': 'Jordan',
'LB': 'Lebanon',
};
function getCountryName(countryCode) {
if (isoCountries.hasOwnProperty(countryCode)) {
return isoCountries[countryCode];
} else {
return countryCode;
}
};
// Load the Visualization API and the corechart package.
google.charts.load('current', {
'packages': ['geochart'],
'mapsApiKey': 'AIzaSyD-9tSrke72PouQMnMX-a7eZSW0jkFMBWY'
});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawRegionsMap);
// Callback that creates and populates a data table,
// instantiates the chart, passes in the data and
// draws it.
function drawRegionsMap() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Country');
data.addColumn('number', 'Members');
data.addRows([
['LB', 3],
['JO', 2],
['IT', 24],
]);
// Set chart options
var options = {
colorAxis: {
colors: ['#c1c1cd', '#53556e']
},
legend: 'none',
backgroundColor: '#efefef'
};
// Create new data table for iso and full country name
var dataMod = new google.visualization.DataTable();
dataMod.addColumn('string', 'Country');
dataMod.addColumn('number', 'Members');
// Adding rows with iso and full country name
var numRows = data.getNumberOfRows();
for (var i = 0; i < numRows; i++) {
dataMod.addRows([
[{
v: String(data.getValue(i, 0)),
f: String(getCountryName(data.getValue(i, 0)))
}, data.getValue(i, 1)],
]);
};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.GeoChart(document.getElementById('regions_div'));
chart.draw(dataMod, options);
}
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<div id="regions_div" style="width: 900px; height: 500px;"></div>

Second Y axis in stacked (positive/negative) bar chart in Google Charts

I have build a stacked bar chart to illustrate positive and negative values which looks like this:
Because these values indicate opposites I want to add additional labels to a right Y axis. Is this even possible? My code so far:
var data = google.visualization.arrayToDataTable([
['Type', 'Value1', 'Value2'],
['Left-1', 0, -5],
['Left-2', 0, -3],
['Left-3', 0, 0],
['Left-4', 3, 0],
['Left-5', 5, 0]
]);
var options = {
legend: 'none',
hAxis: {
minValue: -6,
maxValue: 6
}
}
var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
chart.draw(data, options);
jsfiddle: https://jsfiddle.net/cLz5nffm/
there aren't any standard options for an additional axis in this configuration
but you can add custom labels
once the 'ready' event fires
see following working snippet...
google.charts.load('current', {
callback: drawChart,
packages: ['corechart']
});
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Type', 'Value1', 'Value2'],
['Left-1', 0, -5],
['Left-2', 0, -3],
['Left-3', 0, 0],
['Left-4', 3, 0],
['Left-5', 5, 0]
]);
var options = {
legend: 'none',
hAxis: {
minValue: -6,
maxValue: 6
}
}
var chartDiv = document.getElementById('chart_div');
var chart = new google.visualization.BarChart(chartDiv);
google.visualization.events.addListener(chart, 'ready', function () {
Array.prototype.forEach.call(chartDiv.getElementsByTagName('text'), function(axisLabel) {
if (axisLabel.getAttribute('text-anchor') === 'end') {
addLabel(
axisLabel,
chart.getChartLayoutInterface().getChartAreaBoundingBox().left +
chart.getChartLayoutInterface().getChartAreaBoundingBox().width - 24 // <-- find good width
);
}
});
function addLabel(label, xOffset) {
var axisLabel = label.cloneNode(true);
axisLabel.setAttribute('x', parseFloat(label.getAttribute('x')) + xOffset);
axisLabel.innerHTML = label.innerHTML.replace('Left-', 'Right ');
chartDiv.getElementsByTagName('svg')[0].appendChild(axisLabel);
}
});
chart.draw(data, options);
}
<script src="https://www.gstatic.com/charts/loader.js"></script>
<div id="chart_div"></div>

DFP responsive ads

I have so problem to run responsive DFP ads in my website.
I read all the google specs but still cant figure it out.
<script type='text/javascript'>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
</script>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.defineSlot('/4421777/Textlink', [468, 60], 'div-gpt-ad-1431019765846-0').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.companionAds().setRefreshUnfilledSlots(true);
googletag.pubads().enableVideoAds();
googletag.enableServices();
});
and here is my mapping code :
var mapping = googletag.sizeMapping().
addSize([1024, 768], [970, 250]).
addSize([980, 690], [[1000, 300],[320, 50]]).
addSize([640, 480], [[120, 60],[1000, 300],[320, 50], [468, 60]]).
addSize([0, 0], [88, 31],).
// Fits browsers of any size smaller than 640 x 480
build();
adSlot.defineSizeMapping(mapping);
can you please give some clear way to make it run perfect on mobile etc?
thanks
Your code is incorrect as it doesn't link the size mapping with ad unit.
Note the bold part in my code:
'div-gpt-ad-1431019765846-0').defineSizeMapping(mapping).addService(googletag
Also, I think you need different size mappings for each ad slot.
I am giving an example:
1. You have a big banner on the top of your website, let's say the Ad Unit (Ad Slot) is called Billboard. So, if it is desktop, you want to serve a big banner - 1000x300, if large tablet or small desktop - 728x90 and if it is a mobile device a mobile leaderboard - 320x100.
2. Than you have another ad unit, let's say it is called Rectangle. You want this to serve 300x250 or 300x600 on desktop. 300x250 on tablets and phones.
3. Then you have a third ad unit, let's say it is called Smallbanner. You want this to serve 468x60 on desktop and tablets and no banner on phones.
You will need to create a size mapping for each ad unit and then attach it when called. So in my example case, the output code will be something like this. I am adding inline comments so you can probably understand it better.
<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
</script>
<script type='text/javascript'>
var gptAdSlots = [];
googletag.cmd.push(function() {
// Create size mapping for Billboard position. If viewport is above 1000x768 show banner 1000x300. If viewport is above 728x300 (but bellow 1000x768) show banner 728x90, if viewport is lower than 728x300 show banner 320x100
var billboardsizes = googletag.sizeMapping().addSize([1000, 768], [1000, 300]).addSize([728, 300], [728, 90]).addSize([0, 0], [320, 100]).build();
// Create size mapping for Rectangle position. If viewport is above 1000x768 (considered as desktop, you may lower the height) show 300x250 OR 300x600. If the viewport is smaller than 1000x768 show 300x250 only.
var rectanglesizes = googletag.sizeMapping().addSize([1000, 768], [[300, 60], [300, 250]]).addSize([0, 0], [300, 250]).build();
// Create size mapping for Smallbanner position. If viewport is above 468x300 (considered as desktop + bigger tablets) show 468x60. If smaller, don't show banner.
var smallbannersizes = googletag.sizeMapping().addSize([468, 300], [468, 60]).addSize([0, 0], []).build();
// Now create the first slot. Please note that we add all the sizes described in the size mapping. This should be set in the DFP Ad Unit configuration as well. Please also note the part of the code: .defineSizeMapping(billboardsizes) - it tells DFP what banner to serve on what device size.
gptAdSlots[0] = googletag.defineSlot('/4421777/billboard', [[1000, 300], [320, 100], [728, 90]], 'div-gpt-ad-1431019765846-0').defineSizeMapping(billboardsizes).addService(googletag.pubads());
// Now create the second slot. Please note that we add all the sizes described in the size mapping. This should be set in the DFP Ad Unit configuration as well. Please also note the part of the code: .defineSizeMapping(rectanglesizes) - it tells DFP what banner to serve on what device size. We also incremented gptAdSlots[1] by one and the last number of the div id by 1.
gptAdSlots[1] = googletag.defineSlot('/4421777/rectangle', [[300, 600], [300, 250]], 'div-gpt-ad-1431019765846-1').defineSizeMapping(rectanglesizes).addService(googletag.pubads());
// Now create the third slot. Please note that we add all the sizes described in the size mapping. This should be set in the DFP Ad Unit configuration as well. Please also note the part of the code: .defineSizeMapping(smallbannersizes) - it tells DFP what banner to serve on what device size. We also incremented gptAdSlots[1] by one and the last number of the div id by 1.
gptAdSlots[2] = googletag.defineSlot('/4421777/smallbanner', [468, 60], 'div-gpt-ad-1431019765846-2').defineSizeMapping(smallbannersizes).addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.companionAds().setRefreshUnfilledSlots(true);
googletag.pubads().enableVideoAds();
googletag.enableServices();
});
</script>
Here is a simplified version of what you are trying to achieve (considering your size mapping is weird, as you will display a 1000x300 banner on a device with viewport of 640x480?).
<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
</script>
<script type='text/javascript'>
var gptAdSlots = [];
googletag.cmd.push(function() {
var mapping = googletag.sizeMapping().addSize([1024, 768], [970, 250]).addSize([980, 690], [[1000, 300],[320, 50]]).addSize([640, 480], [[120, 60],[1000, 300],[320, 50], [468, 60]]).addSize([0, 0], [88, 31],).build();
gptAdSlots[0] = googletag.defineSlot('/4421777/Textlink', [[970, 250], [1000, 300], [320, 50], [120, 60], [468, 60], [88, 31]], 'div-gpt-ad-1431019765846-0').defineSizeMapping(mapping).addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.companionAds().setRefreshUnfilledSlots(true);
googletag.pubads().enableVideoAds();
googletag.enableServices();
});
</script>
Take a note that there are few minor changes:
1. An array of the ad slots is created starting with the first being 0. But if you want to call a second slot, you should add something like this after the first one (note the [1], next would be [2] and so on):
gptAdSlots[1] = googletag.defineSlot('/4421777/Textlink2', [300, 250], 'div-gpt-ad-1431019765846-1').defineSizeMapping(mapping2).addService(googletag.pubads());
You should list all the sizes defined in your size mapping in the ad unit sizes as well. Both in DFP Ad Unit setup and in the DefineSlot call (I have done it above).
here is my code now its that correct?
<script async='async' src='https://www.googletagservices.com/tag/js/gpt.js'></script>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
</script>
<script>
googletag.cmd.push(function() {
var mapping = googletag.sizeMapping().addSize([1600, 1024], [1000, 300]).addSize([980, 690], [[1000, 300],[320, 50]]).addSize([640, 480], [[120, 60],[1000, 300],[320, 50], [468, 60]]).addSize([0, 0], [88, 31],).build();
gptAdSlots[0] = googletag.defineSlot('/15076752/300x250_Fifth', [300, 250], 'div-gpt-ad-1476951614543-0').addService(googletag.pubads());
gptAdSlots[1] = googletag.defineSlot('/15076752/300x250_First', [300, 250], 'div-gpt-ad-1476951614543-1').addService(googletag.pubads());
gptAdSlots[2] = googletag.defineSlot('/15076752/300x250_Fourth', [300, 250], 'div-gpt-ad-1476951614543-2').addService(googletag.pubads());
gptAdSlots[3] = googletag.defineSlot('/15076752/300x250_Second', [300, 250], 'div-gpt-ad-1476951614543-3').addService(googletag.pubads());
gptAdSlots[4] = googletag.defineSlot('/15076752/300x250_Third', [300, 250], 'div-gpt-ad-1476951614543-4').addService(googletag.pubads());
gptAdSlots[5] = googletag.defineSlot('/15076752/300x600', [300, 600], 'div-gpt-ad-1476951614543-5').addService(googletag.pubads());
gptAdSlots[6] = googletag.defineSlot('/15076752/728x90_Second', [728, 90], 'div-gpt-ad-1476951614543-6').addService(googletag.pubads());
gptAdSlots[7] = googletag.defineSlot('/15076752/BillBoard-2-1000x300', [1000, 300], 'div-gpt-ad-1476951614543-7').addService(googletag.pubads());
gptAdSlots[8] = googletag.defineSlot('/15076752/Billboard1000x300', [1000, 300], 'div-gpt-ad-1476951614543-8').addService(googletag.pubads());
gptAdSlots[9] = googletag.defineSlot('/15076752/Skin_bg', [1600, 1024], 'div-gpt-ad-1476951614543-9').addService(googletag.pubads());
gptAdSlots[10] = googletag.defineSlot('/15076752/Text_link', [468, 60], 'div-gpt-ad-1476951614543-10').addService(googletag.pubads());
gptAdSlots[11] = googletag.defineSlot('/15076752/Text_link2', [468, 60], 'div-gpt-ad-1476951614543-11').addService(googletag.pubads());
gptAdSlots[12] = googletag.defineSlot('/15076752/Text_link3', [468, 60], 'div-gpt-ad-1476951614543-12').addService(googletag.pubads());
gptAdSlots[13] = googletag.defineSlot('/15076752/Top_728x90', [728, 90], 'div-gpt-ad-1476951614543-13').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.companionAds().setRefreshUnfilledSlots(true);
googletag.pubads().enableVideoAds();
googletag.enableServices();
});
</script>
It look like you are still missing from each gptAdSlots[x]
.defineSizeMapping(mapping2)
You can detect browser width using javascript
Full example:
window.googletag = window.googletag || {cmd: []};
googletag.cmd.push(function() {
var w = Math.max(
document.body.scrollWidth,
document.documentElement.scrollWidth,
document.body.offsetWidth,
document.documentElement.offsetWidth,
document.documentElement.clientWidth
);
if(w>=970) {
googletag.defineSlot('/00000000000/ad', [[970, 90], [728, 90], [468, 60], [320, 50], [300, 100], [234, 60]], 'div-gpt-ad-00000000000000-0').addService(googletag.pubads());
} else if(w>=728) {
googletag.defineSlot('/00000000000/ad', [[728, 90], [468, 60], [320, 50], [300, 100], [234, 60]], 'div-gpt-ad-00000000000000-0').addService(googletag.pubads());
} else if(w>=468) {
googletag.defineSlot('/00000000000/ad', [[468, 60], [320, 50], [300, 100], [234, 60]], 'div-gpt-ad-00000000000000-0').addService(googletag.pubads());
} else if(w>=320) {
googletag.defineSlot('/00000000000/ad', [[320, 50], [300, 100], [234, 60]], 'div-gpt-ad-00000000000000-0').addService(googletag.pubads());
} else if(w>=300) {
googletag.defineSlot('/00000000000/ad', [[300, 100], [234, 60]], 'div-gpt-ad-00000000000000-0').addService(googletag.pubads());
} else if(w>=234) {
googletag.defineSlot('/00000000000/ad', [[234, 60]], 'div-gpt-ad-00000000000000-0').addService(googletag.pubads());
} else {
googletag.defineSlot('/00000000000/ad', [], 'div-gpt-ad-00000000000000-0').addService(googletag.pubads());
}
googletag.pubads().enableSingleRequest();
googletag.pubads().collapseEmptyDivs();
googletag.enableServices();
});
You just have to define adSlot variable
var adSlot = googletag.defineSlot('/4421777/Textlink', [468, 60], 'div-gpt-ad-1431019765846-0').addService(googletag.pubads());

Google DFP returning 400 Bad Request

trying to get the ad slot working on my site. I ad a set of test slot that were working pretty good, then I removed these and created proper named ones. But now, the request url keep returning NetworkError: 400 bad request...It's about to make me go crazy. I have verified and the url is not outsite the 2k char limit.
I build a little test page that is pretty simple, but its still not showing the ad. I have a default "House" line item ad set in that ad unit but it's just now showing. I can see the iframe in the code but it's empty due the the error.
My normal code is more complex with more ad unit and responsive code, but the test one is really simple:
<html>
<head>
<script>
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
(function() {
var gads = document.createElement('script');
gads.async = true;
gads.type = 'text/javascript';
var useSSL = 'https:' == document.location.protocol;
gads.src = (useSSL ? 'https:' : 'http:') +
'//www.googletagservices.com/tag/js/gpt.js';
var node = document.getElementsByTagName('script')[0];
node.parentNode.insertBefore(gads, node);
})();
googletag.cmd.push(function() {
googletag.defineSlot('/xxxxxxxx/OCR-rightsidebar-skyscraper', [160, 600], 'div-gpt-ad-1414630314403-5').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});
</script>
<body>
<!-- OCR-rightsidebar-skyscraper -->
<div id='div-gpt-ad-1414630314403-5' style='width:160px; height:600px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1414630314403-5'); });
</script>
</div>
</body>
</html>
Is there something I don't see here?
Did anyone ever experienced 400 with pubads.g.doubleclick.net?
Any idea how to solve this?..I searched, but everything I came accross so far was not helpful at all.
Thanks