RCarlos

Рейтинг
30
Регистрация
20.01.2020
yodda #:

Вот тебе отдельно сделал за 90 дней скрин.


Зачем замазал? Не видно же! 

Попробовал. Первые 3 месяца платили хорошо, еще через 3 месяца доход упал в три раза 🤪. Платили исправно, каждую неделю. Коды генерят из яндекса.

Снес..., яндекс больше приносит.

Ставьте если в яндексе или гугле не принимают сайты.🤹

Темные они какие-то ни реквизитов ни адресов ни явок 😎

Обкатал😀 Поправил баги. Пользуйтесь

<!-- Шапка -->
<script>window.yaContextCb=window.yaContextCb||[]</script>
<script src="https://yandex.ru/ads/system/context.js" async></script>
<script src="https://yastatic.net/pcode/adfox/loader.js" crossorigin="anonymous"></script>
<script src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-****************" crossorigin="anonymous"></script>
<!-- Google or Yandex -->
<script>
    let adstmer = 0;
    function abygg2(id,arrRTB){
        reszTmr2 = setTimeout(function() {abygg2(id,arrRTB);}, 1000);
        let adstmerObj = adstmer;
        if(adstmerObj >= 5) {clearTimeout(reszTmr2);}
        if (!adsbygoogle.loaded || document.getElementById(id).getAttribute('data-ad-status') == "unfilled") {
        window.yaContextCb.push(()=>{
            Ya.adfoxCode.create( arrRTB )
        });
        clearTimeout(reszTmr2);
    }
    adstmerObj++;
}
</script>
<style>
ins.adsbygoogle[data-ad-status="unfilled"] {display: none !important;}
</style>
<!-- END Шапка -->

<!-- Блок1 -->
<div id="adfox_1111111111111111111111"></div>
<ins class="adsbygoogle" id="adsbygoogle1" style="display:block" data-ad-client="ca-pub-****************" data-ad-slot="1414131223" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    let rtb1 = {
         ownerId: *******,
         containerId: 'adfox_1111111111111111111111',
         params: {
            p1: 'cvbwy',
            p2: 'gyxj',
            pfc: 'eivyq',
            pfb: 'lzngp'
        }
    };
    abygg2('adsbygoogle1',rtb1);
</script>

<!-- Блок2 -->
<div id="adfox_22222222222222222222"></div>
<ins class="adsbygoogle" id="adsbygoogle2" style="display:block" data-ad-client="ca-pub-****************" data-ad-slot="3453453535" data-ad-format="auto" data-full-width-responsive="true"></ins>
<script>
   (adsbygoogle = window.adsbygoogle || []).push({});
   let rtb2 = {
         ownerId: ******,
         containerId: 'adfox_22222222222222222222',
         params: {
            p1: 'cvbwy',
            p2: 'gyxj',
            pfc: 'eivyq',
            pfb: 'lzngq'
        }
    };
   abygg2('adsbygoogle2',rtb2);
</script>

Спасибо  D.iK.iJ #:

D.iK.iJ #:

У себя делал вот так. Показывается реклама Гугла. Если не может или не хочет - Яндекса.

Совместил !adsbygoogle.loaded и таймер. Так не нужно ждать загрузки страницы. Работает корректно только без async в скрипте Гугла.

Дополнительно, блок Гугла скрывается стилями, если пустой:  data-ad-status="unfilled".

Просто  if (!adsbygoogle.loaded) {  что-то толком не работает. То срабатывает сразу (если скрипт вызван асинхронно) то вообще не срабатывает. Говорят, реагирует на Адблок, но я так и не смог заставить это корректно работать.

Делал еще вариант с

в комплекте со стилями

Но там скорость срабатывания такая, что повеситься можно.

P.S. Примера нет, так как открутил рекламу, вывел деньги и скрипт убрал.

Спасибо! И не нужно заморачиваться геотаргетингом!!!

Модернизировал под несколько РК блоков, вроде работает😁

<!-- Шапка -->
<script>window.yaContextCb=window.yaContextCb||[]</script>
<script src="https://yandex.ru/ads/system/context.js" async></script>
<script src="https://yastatic.net/pcode/adfox/loader.js" crossorigin="anonymous"></script>
<script src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-*************" crossorigin="anonymous"></script>

<script>
let adstmer = 0;
function abygg2(id,arrRTB){
    console.log(document.getElementById(id));
    console.log(adsbygoogle2);
    reszTmr2 = setTimeout(function() {abygg2(id,arrRTB);}, 1000);
    let adstmerObj = adstmer;
    if(adstmerObj >= 5) {clearTimeout(reszTmr2);}
    if (!adsbygoogle.loaded || document.getElementById(id).getAttribute('data-ad-status') == "unfilled") {
        arrRTB
        clearTimeout(reszTmr2);
    }
    adstmer++;
}
</script>
<!-- END Шапка -->

<!-- Блок1 -->
<div id="adfox_111111111111111"></div>
<ins class="adsbygoogle" id="adsbygoogle1" style="display:inline-block;width:100%;height:90px" data-ad-client="ca-pub-**********" data-ad-slot="11111111111111"></ins>
<script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    let rtb1 = window.yaContextCb.push(()=>{
                                Ya.adfoxCode.create({
                                    ownerId: *****,
                                    containerId: 'adfox_111111111111111',
                                    params: { p1: 'cvbwy', p2: 'gyxj', pfc: 'eivyq', pfb: 'lyoei'
                                    }
                                })
                            });
    abygg2('adsbygoogle1',rtb1);
</script>

<!-- Блок2 -->
<div id="adfox_2222222222222"></div>
<ins class="adsbygoogle" id="adsbygoogle3" style="display:inline-block;width:100%;height:90px" data-ad-client="ca-pub-**********" data-ad-slot="22222222222222"></ins>
<script>
    (adsbygoogle = window.adsbygoogle || []).push({});
    let rtb2 = window.yaContextCb.push(()=>{
                                Ya.adfoxCode.create({
                                    ownerId: *****,
                                    containerId: 'adfox_2222222222222',
                                    params: { p1: 'cvbwy', p2: 'gyxj', pfc: 'eivyq', pfb: 'lyoei'
                                    }
                                })
                            });
    abygg2('adsbygoogle2',rtb2);
</script>