Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function(){
- var adName = ["clickio_area_638007_336x280"]; // <- сюда пишем массив проверяемых слотов google, может быть достаточно одного
- var checkSlot = function(slotId) {
- return adName.some(function(adName) {
- return slotId.indexOf(adName) !== -1;
- });
- };
- window.googletag = window.googletag || {};
- window.googletag.cmd = window.googletag.cmd || [];
- googletag.cmd.push(function() {
- googletag.pubads().addEventListener("slotResponseReceived" /*"slotRenderEnded"*/, function(event){
- var slotId = event.slot.getSlotId().getId();
- if(checkSlot(slotId))
- {
- if(!event.slot.getResponseInformation())
- {
- /* здесь код, отрабатывающий, если невыкуп*/
- }
- else
- {
- /* если всё хорошо тут берём высоту элемента и подставляем куда нужно отступ */
- }
- }
- });
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement