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

Reviving and moving to prebid 3.0 of smartyAds bi adapter #4671

Merged
merged 10 commits into from
Feb 3, 2020
Merged

Reviving and moving to prebid 3.0 of smartyAds bi adapter #4671

merged 10 commits into from
Feb 3, 2020

Conversation

Aigolkin1991
Copy link
Contributor

Type of change

  • Other

Description of change

Reviving and moving to prebid 3.0 of smartyAds bi adapter

  • test parameters for validating bids
var adUnits = [
                // Will return static native ad. Assets are stored through user UI for each placement separetly
                {
                    code: 'placementId_0',
                    mediaTypes: {
                        native: {}
                    },
                    bids: [
                        {
                            bidder: 'smartyads',
                            params: {
                                placementId: 0,
                                traffic: 'native'
                            }
                        }
                    ]
                },
                // Will return static test banner
                {
                    code: 'placementId_0',
                    mediaTypes: {
                        video: {
                            sizes: [[300, 250]],
                        }
                    },
                    bids: [
                        {
                            bidder: 'smartyads',
                            params: {
                                placementId: 0,
                                traffic: 'video'
                            }
                        }
                    ]
                },
                // Will return test vast xml. All video params are stored under placement in publishers UI
                {
                    code: 'placementId_0',
                    mediaTypes: {
                        banner: {
                            sizes: [[300, 250]],
                        }
                    },
                    bids: [
                        {
                            bidder: 'smartyads',
                            params: {
                                placementId: 0,
                                traffic: 'banner'
                            }
                        }
                    ]
                }
            ];

Copy link
Contributor

@Fawke Fawke left a comment

Choose a reason for hiding this comment

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

Hi @Aigolkin1991,

Thanks for the PR. Your change looks fine, but there are a few things that you might wanna change.

  • The command gulp test is failing due to some error in one of your files.
  • Your unit test file is not following our naming standards. It should be like this, ""YourAdapterName"_spec.js"

Copy link
Contributor

@Fawke Fawke left a comment

Choose a reason for hiding this comment

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

@Aigolkin1991

Unfortunately, I see command, gulp test still failing.

Also, I'd like to test the calls to your SSP if they're returning the correct response or not for all three mediaTypes, banner, video and native.

Can you confirm if the examples provided in the md will work?

@Aigolkin1991
Copy link
Contributor Author

Can you, please, point me, where gulp test errors occurs - github ci/cd doesn't show any the same as local test . Here is terminl output:
` Compiled successfully.
07 01 2020 15:02:46.690:INFO [karma-server]: Karma v3.1.4 server started at http://0.0.0.0:9876/
07 01 2020 15:02:46.692:INFO [launcher]: Launching browsers ChromeHeadless with concurrency unlimited
07 01 2020 15:02:46.717:INFO [launcher]: Starting browser ChromeHeadless
07 01 2020 15:02:47.495:INFO [HeadlessChrome 79.0.3945 (Linux 0.0.0)]: Connected on socket 6BLgN6EHbB6xqKPXAAAA with id 16354162
07 01 2020 15:02:48.835:WARN [web-server]: 404: /vuble_renderer.js
07 01 2020 15:02:51.224:WARN [web-server]: 404: /nurl&s=0.66
07 01 2020 15:02:51.225:WARN [web-server]: 404: /burl&s=0.66
07 01 2020 15:02:52.046:WARN [web-server]: 404: /scriptUrl.com
LOG: 'entrance', '2:52'

Finished in 6.601 secs / 3.564 secs @ 15:02:55 GMT+0200 (Eastern European Standard Time)

SUMMARY:
✔ 4052 tests completed
ℹ 2 tests skipped
[15:02:55] Finished 'test' after 48 s
[15:02:55] Finished 'test' after 1.18 min`

@Fawke
Copy link
Contributor

Fawke commented Jan 8, 2020

@Aigolkin1991,

To see the error, you should run this command gulp test locally on the repository. It's not showing up in circle-ci because it runs this command gulp test --browserstack --nolintfix, so, it essentially bypasses the link checks, and yours is a eslint error.

Here's the screenshot which will point you to the exact error.
Screenshot 2020-01-08 at 11 26 51 AM

@Aigolkin1991
Copy link
Contributor Author

For some reason i'm not seeing error even running gulp test from local work space, but i fixed error using you output

@Fawke
Copy link
Contributor

Fawke commented Jan 9, 2020

Hi @Aigolkin1991,

Thanks for fixing the test case. It's strange that you're not able to see the error. But anyways, it's gone now.

I was testing your Banner, Native and Video with the test parameters that you've provided in your md file. For Banner, I see any problem, but bid responses coming for the native and video didn't seem right.

First, let's talk about native.

  • Your bid response for native request looks like this.

Screenshot 2020-01-09 at 8 05 50 PM

It has the mediaType property set to banner, instead of native.
Also, all the native assets like, title, body, image, ico are not bundled under the native object.

For your reference, here's a response for native request from Appnexus adapter.
Screenshot 2020-01-09 at 8 07 32 PM

As you can see, all the native assets are bundled against the native object.

About, your video bid Response,

  • the mediaTypes is again set to 'banner' instead of 'video'.

I think your adapter supports instream video but it would be better if, in the md file, you can mention the context field as well.

Thanks and let me know if there's any confusion in what I wrote.

@Aigolkin1991
Copy link
Contributor Author

Thanks for native example. I've packed assets into native object on backend side. As for video bids with media type banner - this was due to this line of code in our adapter delete resItem.mediaType;. After media type beeing deleted, bid gets banner media type, despite the fact that we respond with proper mediaType

@Fawke
Copy link
Contributor

Fawke commented Jan 13, 2020

Hi @Aigolkin1991,

Thanks for making the changes. I see that your instream video response is well formed. Would be great if you can,

   // Will return test vast xml. All video params are stored under placement in publishers UI
                {
                    code: 'placementId_0',
                    mediaTypes: {
                        video: {
                            sizes: [[300, 250]],
                        }
                    },
                    bids: [
                        {
                            bidder: 'smartyads',
                            params: {
                                placementId: 0,
                                traffic: 'video'
                            }
                        }
                    ]
                }

Add a key context to indicate that you support instream videos. This way, it'll be easier for reviewers in future to understand you support instream video media type.

Your native mediaType is still not formatted properly.
Screenshot 2020-01-13 at 8 35 42 PM

  • The property clickUrl should be contained inside the native object.

Also, don't you think, in this particular line, it should now be:

return Boolean(bid.native.title && bid.native.image && bid.native.impressionTrackers);

instead of:

return Boolean(bid.title && bid.image && bid.impressionTrackers);

This holds true since you now have moved these properties inside the native object.

Let me know if you have any questions. Thanks.

@Aigolkin1991
Copy link
Contributor Author

Thanks for review, i've made changes into adapter and backend side

@Fawke
Copy link
Contributor

Fawke commented Jan 16, 2020

@Aigolkin1991,

I still see property clickUrl not inside the native object. Please make this change because validation fails, saying " Prebid ERROR: Invalid bid from smartyads. Ignoring bid: Native bid missing some required properties."

Screenshot 2020-01-16 at 12 53 09 PM

Also, I see 3 test cases failing. You can run the command gulp test locally to know more about it. But attacked a screenshot for your reference as well.

Screenshot 2020-01-16 at 12 35 25 PM

@Fawke
Copy link
Contributor

Fawke commented Jan 20, 2020

Hi @Aigolkin1991,

Thanks for fixing the unit test cases and moving the property clickUrl inside the native object. I think there's still a small typo in the response object due to which I am getting this error.

Screenshot 2020-01-20 at 12 40 23 PM

I think it's because of this:
Screenshot 2020-01-20 at 12 39 25 PM

You've misspelled icon as ico.

@Aigolkin1991
Copy link
Contributor Author

I've fixed that on our backendside

@Aigolkin1991 Aigolkin1991 requested a review from Fawke January 27, 2020 13:19
Copy link
Contributor

@Fawke Fawke left a comment

Choose a reason for hiding this comment

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

LGTM

@Fawke Fawke merged commit d0542cb into prebid:master Feb 3, 2020
hellsingblack pushed a commit to SublimeSkinz/Prebid.js that referenced this pull request Mar 5, 2020
* revive smarty sadapter, upgrade to 3.0

* revive smarty adapter, upgrade to 3.0

* name change

* fix

* fix

* Update smartyadsBidAdapter.md

* remove propertie deation

* video context, native validness check

* fix test
@Fawke Fawke added the LGTM label Apr 7, 2020
@Fawke Fawke removed the needs update label Apr 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants