Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fatihkaya84 committed Jan 15, 2024
1 parent f1ddbf8 commit ed7bc2b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
15 changes: 7 additions & 8 deletions ads/vendors/pixad.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ import {validateData, writeScript} from '#3p/3p';
* @param {!Object} data
*/
export function pixad(global, data) {
validateData(data, ['adNetwork','adPublisher','adTypeId']);
validateData(data, ['adNetwork', 'adPublisher', 'adTypeId']);
global._pixad = global._pixad || {
publisher: data['adNetwork'],
adNetwork: data['adPublisher'],
adTypeId: data['adTypeId'],
host: `static.cdn.pixad.com.tr`,
prefix: `px`
prefix: `px`,
};

if(data['adNetwork'].indexOf("adm-pub") != -1) {
if (global._pixad.publisher.indexOf('adm-pub') != -1) {
global._pixad.host = `static.cdn.admatic.com.tr`;
global._pixad.prefix = `adm`;
};
}

const ins = global.document.createElement('ins');
ins.setAttribute('data-publisher', global._pixad.publisher);
if(global._pixad.adTypeId == "standard") {
if (global._pixad.adTypeId == 'standard') {
ins.setAttribute('data-ad-size', `[[${data.width},${data.height}]]`);
};
}
ins.setAttribute('data-ad-network', global._pixad.adNetwork);
ins.setAttribute('data-ad-type-id', global._pixad.adTypeId);
ins.setAttribute('class', `${global._pixad.prefix}-ads-area`);
Expand All @@ -34,5 +34,4 @@ export function pixad(global, data) {
);

writeScript(global, `https://${global._pixad.host}/showad/showad.min.js`);

}
}
1 change: 1 addition & 0 deletions examples/amp-ad/ads.amp.esm.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@
<option>openx</option>
<option>opinary</option>
<option>outbrain</option>
<option>pixad</option>
<option>pixels</option>
<option>plista</option>
<option>polymorphicads</option>
Expand Down
1 change: 1 addition & 0 deletions examples/amp-ad/ads.amp.html
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@
<option>openx</option>
<option>opinary</option>
<option>outbrain</option>
<option>pixad</option>
<option>pixels</option>
<option>playstream</option>
<option>plista</option>
Expand Down

0 comments on commit ed7bc2b

Please sign in to comment.