Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Different sectors in a page does not seem to work #142

Open
yourchoice opened this issue Jan 13, 2017 · 1 comment
Open

Different sectors in a page does not seem to work #142

yourchoice opened this issue Jan 13, 2017 · 1 comment

Comments

@yourchoice
Copy link

Different sectors in a page does not seem to work

<div class="adunit1" data-adunit="PC_TEST_300x600" data-dimensions="300x600"></div>
<div class="adunit2" data-adunit="HALFPAGE" data-dimensions="300x600"></div>
$('.adunit1').dfp({
    'dfpID': '11111111',
    afterEachAdLoaded: function (adUnit) {
        if ($(adUnit).hasClass('display-none')) {
            console.log('Ad not found');
        } else {
            console.log('Ad found');
        }
    },
    afterAllAdsLoaded: function (adUnits) {
        console.log('all ads are loaded'+adUnits);
    }
});
		
$('.adunit2').dfp({
    'dfpID': '22222222',
    afterEachAdLoaded: function (adUnit) {				
        if ($(adUnit).hasClass('display-none')) {
            console.log('Ad2 not found');
         } else {
            console.log('Ad2 found');
         }
     },
     afterAllAdsLoaded: function (adUnits) {				
	console.log('all ads2 are loaded'+adUnits);
    }
});

Console.log show:

Ad1 not found
all ads1 are loaded []
Ad2 not found

Seems that afterAllAdsLoaded $('.adunit2') not fired.

And seems that second block the first...

@yourchoice
Copy link
Author

yourchoice commented Jan 13, 2017

Sometimes I see in logs:

Ad2 not found
all ads2 are loaded
Ad1 not found

And afterAllAdsLoaded $('.adunit1') not fired.

And sometime, even in code i have just one div with class adunit1 and one div with class adunit2 I see:

Ad2 not found
Ad1 not found
all ads1 are loaded
Ad2 not found
Ad1 not found

So, for each exists 2 calls and last afterAllAdsLoaded not fired

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant