-
Notifications
You must be signed in to change notification settings - Fork 2k
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
51Degrees RTD submodule: initial commit #11414
Merged
patmmccann
merged 24 commits into
prebid:master
from
51Degrees:feature/51DegreesRtdProvider
May 18, 2024
Merged
Changes from 10 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e243ff4
51Degrees RTD provider
BohdanVV c3b69ec
Amended comments and documentation to improve references for obtainin…
jwrosewell 989a5ab
Modified the maintainer email address.
jwrosewell f50b14b
Change outdated URL
BohdanVV e0663e8
Adjust code to work on legacy browsers
BohdanVV 45761cc
Refactor a test of the `inject` method
BohdanVV bd24631
Replace URL in a test method
BohdanVV d4d6f2c
51Degrees RTD provider: remove redundant parameter from the example
BohdanVV b7a4258
51Degrees RTD provider: update gpt.js URL in the example file
BohdanVV f11f87c
51Degrees RTD provider: add schema to the `is51DegreesMetaPresent` me…
BohdanVV 818f343
51Degrees RTD provider: refactor `51Degrees` script injection method
BohdanVV 8ecd4b8
51Degrees RTD provider: show enriched device data in the example page
BohdanVV 76f6a3a
51Degrees RTD provider: provide additional explanation for checking m…
BohdanVV 767ff78
51Degrees RTD provider: update string for meta tag check
BohdanVV 0e7a79e
Merge branch 'master' into feature/51DegreesRtdProvider
BohdanVV 798d59c
51Degrees RTD provider: improve tests, reach 100% tests coverage
BohdanVV af66b58
Merge branch 'prebid:master' into feature/51DegreesRtdProvider
BohdanVV aed54e9
Merge branch 'master' into feature/51DegreesRtdProvider
BohdanVV b5a679a
Merge branch 'feature/51DegreesRtdProvider-100-coverage' into feature…
BohdanVV e1d31a6
Merge branch 'master' into feature/51DegreesRtdProvider
BohdanVV 75f9461
51d example: debug warning and guidance
justadreamer 8f4ae8a
51d doc: add GetHighEntropyValues vs. Delegate-CH
justadreamer fb3d7e9
51d: fix minor doc omissions
justadreamer 531deca
Merge pull request #2 from 51Degrees/feature/51DegreesRtdProvider-rev…
justadreamer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
168 changes: 168 additions & 0 deletions
168
integrationExamples/gpt/51DegreesRtdProvider_example.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta http-equiv="Delegate-CH" content="sec-ch-ua-full-version-list https://cloud.51degrees.com; sec-ch-ua-model https://cloud.51degrees.com; sec-ch-ua-platform https://cloud.51degrees.com; sec-ch-ua-platform-version https://cloud.51degrees.com"> | ||
<script async src="https://securepubads.g.doubleclick.net/tag/js/gpt.js"></script> | ||
<script async src="../../build/dev/prebid.js"></script> | ||
<meta charset="utf-8"> | ||
<style> | ||
body { | ||
color: #555; | ||
font-family: sans-serif; | ||
} | ||
</style> | ||
<script> | ||
var PREBID_TIMEOUT = 1000; | ||
var FAILSAFE_TIMEOUT = 3000; | ||
|
||
var googletag = googletag || {}; | ||
googletag.cmd = googletag.cmd || []; | ||
|
||
var pbjs = pbjs || {}; | ||
pbjs.que = pbjs.que || []; | ||
|
||
function initAdserver() { | ||
if (pbjs.initAdserverSet) return; | ||
|
||
googletag.cmd.push(function () { | ||
pbjs.que.push(function () { | ||
pbjs.setTargetingForGPTAsync(); | ||
googletag.pubads().refresh(); | ||
}); | ||
}); | ||
|
||
pbjs.initAdserverSet = true; | ||
} | ||
|
||
pbjs.que.push(function () { | ||
var adUnits = [{ | ||
code: 'div-banner-native-1', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [ | ||
[300, 250] | ||
] | ||
}, | ||
native: { | ||
type: 'image' | ||
}, | ||
}, | ||
bids: [{ | ||
bidder: 'appnexus', | ||
params: { | ||
placementId: 13232392, | ||
} | ||
}] | ||
}, | ||
{ | ||
code: 'div-banner-native-2', | ||
mediaTypes: { | ||
banner: { | ||
sizes: [ | ||
[300, 250] | ||
] | ||
}, | ||
native: { | ||
title: { | ||
required: true | ||
}, | ||
image: { | ||
required: true | ||
}, | ||
sponsoredBy: { | ||
required: true | ||
} | ||
} | ||
}, | ||
bids: [{ | ||
bidder: 'appnexus', | ||
params: { | ||
placementId: 13232392, | ||
} | ||
}] | ||
} | ||
]; | ||
|
||
pbjs.setConfig({ | ||
debug: true, | ||
realTimeData: { | ||
jwrosewell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
auctionDelay: 1000, // should be set lower in production use | ||
dataProviders: [ | ||
{ | ||
name: '51Degrees', | ||
waitForIt: true, | ||
params: { | ||
// Get your resource key from https://configure.51degrees.com/tWrhNfY6 | ||
resourceKey: '<YOUR_RESOURCE_KEY>', | ||
// alternatively, you can use the on-premise version of the 51Degrees service and connect to your chosen end point | ||
// onPremiseJSUrl: 'https://localhost/51Degrees.core.js' | ||
} | ||
} | ||
] | ||
}, | ||
}); | ||
|
||
pbjs.addAdUnits(adUnits); | ||
pbjs.requestBids({ | ||
timeout: PREBID_TIMEOUT, | ||
bidsBackHandler: function (bidResponses) { | ||
initAdserver(); | ||
} | ||
}); | ||
}); | ||
setTimeout(initAdserver, FAILSAFE_TIMEOUT); | ||
</script> | ||
|
||
<script> | ||
googletag.cmd.push(function () { | ||
googletag | ||
.defineSlot( | ||
'/19968336/prebid_multiformat_test', [ | ||
[300, 250], | ||
[360, 360] | ||
], | ||
'div-banner-native-1' | ||
) | ||
.addService(googletag.pubads()); | ||
|
||
googletag | ||
.defineSlot( | ||
'/19968336/prebid_multiformat_test', [ | ||
[300, 250], | ||
[360, 360] | ||
], | ||
'div-banner-native-2' | ||
) | ||
.addService(googletag.pubads()); | ||
|
||
googletag.pubads().disableInitialLoad(); | ||
googletag.pubads().enableSingleRequest(); | ||
googletag.enableServices(); | ||
}); | ||
</script> | ||
<title>51Degrees RTD submodule example - Prebid.js</title> | ||
</head> | ||
<body> | ||
<h2>51Degrees RTD submodule - example of usage</h2> | ||
|
||
<h3>div-banner-native-1</h3> | ||
<div id='div-banner-native-1'> | ||
<p>No response</p> | ||
<script type='text/javascript'> | ||
googletag.cmd.push(function () { | ||
googletag.display('div-banner-native-1'); | ||
}); | ||
</script> | ||
</div> | ||
|
||
<h3>div-banner-native-2</h3> | ||
<div id='div-banner-native-2'> | ||
<p>No response</p> | ||
<script type='text/javascript'> | ||
googletag.cmd.push(function () { | ||
googletag.display('div-banner-native-2'); | ||
}); | ||
</script> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a tiny bit dangerous in an example; i would add a comment here to tell devs to be careful not to run debug in production