Skip to content

Commit

Permalink
Add Revcontent Adapter (#4654)
Browse files Browse the repository at this point in the history
* Initial commit

* Update

* Update js

* Update file name

* Making it work (at least getting a response)

* Update native logic

* Updates to bidder

* Update prebidder

* Remove debugs

* Updates

* Add new templates

* Update templates

* Update email address

* Resolve conflict

* Resolve conflict

* Rebase from master

* Rebase from master

* Add Revcontent Adapter

* Force https, update supportedMediaTypes and add default return for extractHostname method

* Add test file + remove console.log statement
  • Loading branch information
AzizSaleh authored and robertrmartinez committed Jan 8, 2020
1 parent 644e54b commit 8c42f02
Show file tree
Hide file tree
Showing 5 changed files with 796 additions and 0 deletions.
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

0 comments on commit 8c42f02

Please sign in to comment.