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

Pr 0507 - support for dctr, currency and multi-size ad slots #2887

Merged
merged 19 commits into from
Jul 27, 2018

Conversation

pm-manasi-moghe
Copy link
Contributor

Type of change

  • [ x] Feature

Description of change

  • Added support for dctr parameter
  • Added provision to get bids through the PubMatic Prebid.js adapter in any supported currency
  • Added support to automatically handle multi-size ad slots

Be sure to test the integration with your adserver using the Hello World sample page.

  • contact email of the adapter’s maintainer
  • [ x] official adapter submission

For any changes that affect user-facing APIs or example code documented on http://prebid.org, please provide:

@jsnellbaker jsnellbaker self-requested a review July 24, 2018 16:14
@jsnellbaker jsnellbaker self-assigned this Jul 24, 2018
Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

Hi @pm-manasi-moghe
These changes look okay. However when I was testing the merge to master by running our browserstack tests, I was seeing a consistent test failure in safari.

Below is a copy of the error details:

  PubMatic adapter
    implementation
      Request formation
        �[31m✗ �[39m�[31mRequest params multi size format object check�[39m
	expected [] to have a length above 0 but got 0
	AssertionError@webpack:///node_modules/assertion-error/index.js:74 <- test/test_index.js:20203:22
	assert@webpack:///node_modules/chai/lib/chai/assertion.js:107 <- test/test_index.js:27769:31
	assertAbove@webpack:///node_modules/chai/lib/chai/core/assertions.js:563 <- test/test_index.js:28362:18
	webpack:///node_modules/chai/lib/chai/utils/addMethod.js:41 <- test/test_index.js:27356:30
	webpack:///test/spec/modules/pubmaticBidAdapter_spec.js:306:88 <- test/test_index.js:104082:99

Could you take a look and see what may be the problem?

@pm-manasi-moghe
Copy link
Contributor Author

pm-manasi-moghe commented Jul 26, 2018

Hi @jsnellbaker,

The test case looks ok, and works at my end. I have made a small change in it, so as to narrow down the cause of the failure at your end. Please let me know the status with the updated code.

@@ -251,6 +262,14 @@ function _createImpressionObject(bid, conf) {
h: bid.params.height,
topframe: utils.inIframe() ? 0 : 1,
}
if (utils.isArray(sizes) && sizes.length > 1) {
sizes = sizes.splice(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hi @pm-manasi-moghe

I ran the updated unit test and the issue appeared to be the format object was getting an empty array.

I did some further debugging/experimenting and I believe the problem was due to this line of code.

When I added a proper range value as the 2nd param in the splice (like the following), the unit test completed successfully in Safari. I wasn't able to find anything definitive but it seemed like this was needed for the es5 shim of the splice to work. Can you implement this change?

var range = sizes.length - 1;
sizes = sizes.splice(1, range);

@pm-manasi-moghe
Copy link
Contributor Author

@jsnellbaker,

Made the required changes.

Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

Thanks for making the updates; LGTM

@jsnellbaker jsnellbaker merged commit 66d218b into prebid:master Jul 27, 2018
florevallatmrf pushed a commit to Marfeel/Prebid.js that referenced this pull request Sep 6, 2018
…2887)

* merging latest prebid master with video changes

* fixed linting errors

* moved data types to constants

* merging changes for currency support and multisize support

* replace hardcoded string 'pubmatic' with BIDDER_CODE

* added code for dctr support

* trim individual values in key-value

* additional log messages added

* fixed linting errors

* fix test cases for dctr

* rename paramter bidfloorcur to currency.

* rename param bidfloorcur to currency

* remove data_types constant from constants.json

* changes to test cases for format object

* change to splice method call as per review comments
StefanWallin pushed a commit to mittmedia/Prebid.js that referenced this pull request Sep 28, 2018
…2887)

* merging latest prebid master with video changes

* fixed linting errors

* moved data types to constants

* merging changes for currency support and multisize support

* replace hardcoded string 'pubmatic' with BIDDER_CODE

* added code for dctr support

* trim individual values in key-value

* additional log messages added

* fixed linting errors

* fix test cases for dctr

* rename paramter bidfloorcur to currency.

* rename param bidfloorcur to currency

* remove data_types constant from constants.json

* changes to test cases for format object

* change to splice method call as per review comments
@PubMatic-OpenWrap PubMatic-OpenWrap deleted the PR_0507 branch November 29, 2018 07:26
ghost pushed a commit to devunrulymedia/Prebid.js that referenced this pull request Jan 30, 2019
…2887)

* merging latest prebid master with video changes

* fixed linting errors

* moved data types to constants

* merging changes for currency support and multisize support

* replace hardcoded string 'pubmatic' with BIDDER_CODE

* added code for dctr support

* trim individual values in key-value

* additional log messages added

* fixed linting errors

* fix test cases for dctr

* rename paramter bidfloorcur to currency.

* rename param bidfloorcur to currency

* remove data_types constant from constants.json

* changes to test cases for format object

* change to splice method call as per review comments
AlessandroDG pushed a commit to simplaex/Prebid.js that referenced this pull request Mar 26, 2019
…2887)

* merging latest prebid master with video changes

* fixed linting errors

* moved data types to constants

* merging changes for currency support and multisize support

* replace hardcoded string 'pubmatic' with BIDDER_CODE

* added code for dctr support

* trim individual values in key-value

* additional log messages added

* fixed linting errors

* fix test cases for dctr

* rename paramter bidfloorcur to currency.

* rename param bidfloorcur to currency

* remove data_types constant from constants.json

* changes to test cases for format object

* change to splice method call as per review comments
AlessandroDG pushed a commit to simplaex/Prebid.js that referenced this pull request Mar 26, 2019
…2887)

* merging latest prebid master with video changes

* fixed linting errors

* moved data types to constants

* merging changes for currency support and multisize support

* replace hardcoded string 'pubmatic' with BIDDER_CODE

* added code for dctr support

* trim individual values in key-value

* additional log messages added

* fixed linting errors

* fix test cases for dctr

* rename paramter bidfloorcur to currency.

* rename param bidfloorcur to currency

* remove data_types constant from constants.json

* changes to test cases for format object

* change to splice method call as per review comments
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.

3 participants