forked from coop182/jquery.dfp.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example-bootstrap.js
41 lines (26 loc) · 774 Bytes
/
example-bootstrap.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
(function ($, window) {
"use strict";
$.getScript("jquery.dfp.min.js", function () {
$.dfp({
// Set the DFP ID
'dfpID': 'xxxxxxxx',
// Callback which is run after the render of each ad.
afterEachAdLoaded: function (adUnit) {
// Do something after each ad is loaded.
if ($(adUnit).hasClass('display-none')) {
// Ad not found
} else {
// Ad found
}
},
// Callback which is run after the render of all ads.
afterAllAdsLoaded: function (adUnits) {
// Do something after all ads are loaded.
},
alterAdUnitName: function(adUnitName,adUnit) {
// Modify add unit name. For example, can add a prefix or suffix
return 'PREFIX_' + adUnitName + '_SUFFIX';
}
});
});
})(window.jQuery, window);