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

Invibes Bid Adapter : change referrer formatting #10017

Merged
merged 8 commits into from
Jul 14, 2023
4 changes: 2 additions & 2 deletions modules/invibesBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const CONSTANTS = {
SYNC_ENDPOINT: 'https://k.r66net.com/GetUserSync',
TIME_TO_LIVE: 300,
DEFAULT_CURRENCY: 'EUR',
PREBID_VERSION: 9,
PREBID_VERSION: 10,
METHOD: 'GET',
INVIBES_VENDOR_ID: 436,
USERID_PROVIDERS: ['pubcid', 'pubProvidedId', 'uid2', 'zeotapIdPlus', 'id5id'],
Expand Down Expand Up @@ -372,7 +372,7 @@ function generateRandomId() {
}

function getDocumentLocation(topWin) {
return topWin.location.href.substring(0, 300).split(/[?#]/)[0];
return topWin.location.href.substring(0, 300);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use site.page on the request object

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greetings @patmmccann ! The purpose of this change request is only to stop truncating the domain url after the '?#' characters. We do not wish to change how we are getting the domain url. We have been using topWin.location.href since the adapter has been submitted years ago, we have had no issues with this and if we change it now, we would have to retest a lot of the integrations that are working fine now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prebid team and community have put a lot of work into making sure https://github.com/prebid/Prebid.js/blob/master/src/refererDetection.js gives the best possible results. Publishers and buyers often expect consistent determinations of site.page across integrations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @patmmccann ! I understand the concern but you are requesting a change in the Invibes adapter that is not part of the scope of this pull request. From my knowledge this is not standard prebid policy.

This pull request however was for a bugfix on one of our integrations, the change was minor (removal of split function, NOT access to window object) and we needed to implement it as fast as possible (it has been dragging on for weeks at this point)

We will of course implement this if required as a SEPARATE issue, with a different pull request and we require the appropriate time for it.

Thank you for understanding

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not out of scope; you are accessing the page url incorrectly. Your pr revises how to gather the pageurl. It remains incorrect

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @patmmccann, we have made the requested changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @patmmccann , an update please?

}

function getUserIds(bidUserId) {
Expand Down
7 changes: 7 additions & 0 deletions test/spec/modules/invibesBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,13 @@ describe('invibesBidAdapter:', function () {
expect(parsedData.height).to.exist;
});

it('has location not cut off', function () {
const request = spec.buildRequests(bidRequests, {auctionStart: Date.now()});
const parsedData = request.data;
expect(parsedData.location).to.exist;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Write out an actual input and output

expect(parsedData.location).to.contain('?');
});

it('has capped ids if local storage variable is correctly formatted', function () {
top.window.invibes.optIn = 1;
top.window.invibes.purposes = [true, false, false, false, false, false, false, false, false, false];
Expand Down