Skip to content

Neuwo RTD Module: apiUrl-param handling improved #9646

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

Merged
merged 1 commit into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 4 additions & 3 deletions integrationExamples/gpt/neuwoRtdProvider_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<script src="../../build/dev/prebid.js" async type="text/javascript"></script>
<script async src="//www.googletagservices.com/tag/js/gpt.js"></script>
<script>
var helper = document.getElementById('need-help');
if (helper) helper.style.display = location.href !== 'http://localhost:9999/integrationExamples/gpt/neuwoRtdProvider_example.html' ? 'block' : 'none';

/* adapted from https://docs.prebid.org/dev-docs/examples/basic-example.html */
var div_1_sizes = [
[300, 250],
Expand Down Expand Up @@ -197,4 +194,8 @@ <h5>Div-2</h5>
</div>

</body>
<script type="text/javascript">
var helper = document.getElementById('need-help');
if (helper) helper.style.display = location.href !== 'http://localhost:9999/integrationExamples/gpt/neuwoRtdProvider_example.html' ? 'block' : 'none';
</script>
</html>
5 changes: 3 additions & 2 deletions modules/neuwoRtdProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ export function getBidRequestData(reqBidsConfigObj, callback, config, userConsen
logInfo('NeuwoRTDModule', 'starting getBidRequestData')

const wrappedArgUrl = encodeURIComponent(config.params.argUrl || getRefererInfo().page);
const url = config.params.apiUrl + [
/* adjust for pages api.url?prefix=test (to add params with '&') as well as api.url (to add params with '?') */
const joiner = config.params.apiUrl.indexOf('?') < 0 ? '?' : '&'
const url = config.params.apiUrl + joiner + [
'token=' + config.params.publicToken,
'lang=en',
'url=' + wrappedArgUrl
].join('&')
const billingId = generateUUID();
Expand Down