Skip to content

Commit

Permalink
Minor change in adpushup vendor (#37194)
Browse files Browse the repository at this point in the history
Added a flag to serve script from different domain

Co-authored-by: Rahul Ranjan <58460728+RahulAdpushup@users.noreply.github.com>
  • Loading branch information
madan-mayank and RahulAdpushup committed Dec 13, 2021
1 parent dc3f7e0 commit 5dc7237
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions ads/vendors/adpushup.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,29 @@ export function adpushup(global, data) {
validateData(
data,
['siteid', 'slotpath', 'width', 'height'],
['totalampslots', 'jsontargeting', 'extras']
['totalampslots', 'jsontargeting', 'extras', 'loadalternate']
);
loadScript(
global,
'https://securepubads.g.doubleclick.net/tag/js/gpt.js',
() => {
loadScript(
global,
'https://cdn.adpushup.com/' + data.siteid + '/amp.js',
() => {
window.adpushup.initAmp(
global,
data.width,
data.height,
data.siteid,
data.slotpath,
data.totalampslots,
data.jsontargeting,
data.extras
);
}
);
const domain =
data.loadalternate === 'true'
? 'https://assets.adpushup.com/'
: 'https://cdn.adpushup.com/';
const url = domain + data.siteid + '/amp.js';
loadScript(global, url, () => {
window.adpushup.initAmp(
global,
data.width,
data.height,
data.siteid,
data.slotpath,
data.totalampslots,
data.jsontargeting,
data.extras
);
});
}
);
}

0 comments on commit 5dc7237

Please sign in to comment.