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

Conversation

mihaisandu07
Copy link
Contributor

Type of change

  • Bugfix

  • Feature

  • New bidder adapter

  • Code style update (formatting, local variables)

  • Refactoring (no functional changes, no api changes)

  • Build related changes

  • CI related changes

  • Does this change affect user-facing APIs or examples documented on http://prebid.org?

  • Other

Description of change

Removed cutoff of url parameters from location param sent to AdServer.

Other information

Removed cutoff of url parameters from location param.
Copy link
Collaborator

@patmmccann patmmccann left a comment

Choose a reason for hiding this comment

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

make sure your tests are passing and that you cover this change in a test

@patmmccann patmmccann changed the title Update invibesBidAdapter.js InvibesBidAdapter: change referrer formatting Jun 5, 2023
add unit test for cut off location
@mihaisandu07
Copy link
Contributor Author

@patmmccann I've added a unit test and all unit tests are now passing. The only error is triggered by failed test on gothamadsBidAdapter_spec on which I don't have control

@ChrisHuie ChrisHuie changed the title InvibesBidAdapter: change referrer formatting Invibes Bid Adapter : change referrer formatting Jun 7, 2023
@patmmccann
Copy link
Collaborator

Tests failed to run, circleci says 0 of 0 complete

@@ -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?

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

@mihaisandu07
Copy link
Contributor Author

@patmmccann Can you please review? We made the requested changes more than 2 weeks ago.

Copy link
Collaborator

@patmmccann patmmccann left a comment

Choose a reason for hiding this comment

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

please delete the getconfig and make sure you pass tests

We've had a holiday in the United States, not much got reviewed last week,

var site = getConfig('site') || {};

if (!site.page) {
site.page = bidderRequest.refererInfo.page;
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 all you need, you don't need to check config; however your circle ci tests failed

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 , I've simplified the mode to get the page url and removed the config.

Regarding the unit tests, all of our unit tests are passsing, the errors are on gothamadsBidAdapter_spec.js and e_volutionBidAdapter_spec.js which are NOT our adapters so they are our of our control.

Please let me know if everything else is ok.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes; looking into test failure, hopefully should have an answer quickly

simplified the fetching of the page url
remove unused config library
@ChrisHuie
Copy link
Collaborator

@mihaisandu07 can you pull in recent commits on master into this pr. Should fix the errors.

@mihaisandu07
Copy link
Contributor Author

@ChrisHuie thanks, I've synced the MASTER and everything looks ok now.

@patmmccann patmmccann merged commit 601ed4a into prebid:master Jul 14, 2023
2 checks passed
santii7395 pushed a commit to themaven-net/Prebid.js that referenced this pull request Aug 28, 2023
* Update invibesBidAdapter.js

Removed cutoff of url parameters from location param.

* Update invibesBidAdapter_spec.js

add unit test for cut off location

* Update invibesBidAdapter_spec.js

updated unit tests to do a better check on location href

* changed the way InvibesBidAdapter gets the page location.

* Update invibesBidAdapter.js

simplified the fetching of the page url

* Update invibesBidAdapter.js

remove unused config library

* updated invibes unit tests to accomodate the new page url fetching method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants