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

Add Revcontent Adapter #4654

Merged
merged 21 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions integrationExamples/gpt/revcontent_example.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<html>

<head>
<link rel="icon" type="image/png" href="/favicon.png">
<script async src="//www.googletagservices.com/tag/js/gpt.js"></script>
<script async src="../../build/dev/prebid.js"></script>
<script>
/*
Supported sizes:
----------------
300x250 - Medium rectangle
728x90 - Leaderboard
300x600 - Half page or large skyscraper
*/
var size = {width: 300, height: 250};

var PREBID_TIMEOUT = 10000;
var FAILSAFE_TIMEOUT = 30000;

var adUnits = [{
code: '/19968336/header-bid-tag-1',
mediaTypes: {
native: {
image: {
required: false
},
title: {
required: false,
len: 140
},
clickUrl: {
required: false
},
sponsoredBy: {
id: 5,
name: 'data',
type: 1
}
}
},
bids: [{
bidder: 'revcontent',
params: {
size: size,
apiKey: '8a33fa9cf220ae685dcc3544f847cdda858d3b1c',
userId: 673,
domain: 'test.com',
endpoint: 'trends-s0.revcontent.com'
}
}]
}];

// ======== DO NOT EDIT BELOW THIS LINE =========== //
var googletag = googletag || {};
googletag.cmd = googletag.cmd || [];
googletag.cmd.push(function() {
googletag.pubads().disableInitialLoad();
});

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

pbjs.que.push(function() {
pbjs.addAdUnits(adUnits);
pbjs.requestBids({
bidsBackHandler: initAdserver,
timeout: PREBID_TIMEOUT
});
});

function initAdserver() {
if (pbjs.initAdserverSet) return;
pbjs.initAdserverSet = true;
googletag.cmd.push(function() {
pbjs.setTargetingForGPTAsync && pbjs.setTargetingForGPTAsync();
googletag.pubads().refresh();
});
}

// in case PBJS doesn't load
setTimeout(function() {
initAdserver();
}, FAILSAFE_TIMEOUT);

googletag.cmd.push(function() {
googletag.defineSlot('/19968336/header-bid-tag-1', [[size.width, size.height]], 'div-1')
.addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices();
});

</script>

</head>

<body>
<h2>Basic Prebid.js Example</h2>
<h5>Div-1</h5>
<div id='div-1'>
<script type='text/javascript'>
googletag.cmd.push(function() {
googletag.display('div-1');
});

</script>
</div>
</body>

</html>
Loading