Prebid.js: Adapter for Amazon A9

Created on 7 Jun 2016  路  16Comments  路  Source: prebid/Prebid.js

Would you accept a PR with an adapter for Amazon A9? I'm currently implementing one.

The reason I ask is that there used to be an adapter for Amazon A9, and it was removed:
https://github.com/prebid/Prebid.js/issues/64

From what I know, Amazon's main concern is data leakage, so they don't expose the CPM of their bids on the client side. However, as long as the CPMs are not decoded on the client, the adapter should abide by Amazon's guidelines. This constraint makes it a little clunky to integrate it into Prebid, but not too bad.

My approach is to hardcode a low CPM value in every Amazon bid response. In the bidder settings, I'm setting alwaysUseBid to true and including the custom adserver targeting amznslots key (which maps to a line item with a secret CPM on the ad server side).

Since Amazon A9 is a fairly popular heading bidder partner, I don't think it makes sense to make every publisher build their own custom adapter.

question

Most helpful comment

Ok. In case it's helpful to people down the line, here's the custom adapter we're using in production:
https://github.com/kmjennison/Prebid.js/blob/kevin/amazon-adapter/src/adapters/amazon.js

I'll let our contact at A9 know about the adapter to see if they'd reconsider allowing it in the official repo.

All 16 comments

@kmjennison
Amazon doesn't wish to participate in this project. As such, we cannot accept a PR with their code.

Ok. In case it's helpful to people down the line, here's the custom adapter we're using in production:
https://github.com/kmjennison/Prebid.js/blob/kevin/amazon-adapter/src/adapters/amazon.js

I'll let our contact at A9 know about the adapter to see if they'd reconsider allowing it in the official repo.

@kmjennison
Thanks!

@kmjennison Hi; was curious to know how did it go with the amazon custom adapter? Did they accept it in the end? Thanks!

@Claretta No, they haven't released an official Prebid adapter, and I haven't heard of any plans to do so. However, we're still using this unofficial adapter with no problems.

Thanks, @kmjennison!

@kmjennison thanks dude!

thanks @kmjennison , do you happen to have an example adUnits config using the amazon adapter with custom slots at different cpm levels?

@mattfca Here's an example bid config for the custom A9 adapter in a 728x90 placement:

{
    bidder: 'amazon',
    params: {
        amazonId: '1234',
        width: 728,
        height: 90,
        size: '7x9',
    }
}

I'm not sure what you mean by "custom slots at different cpm levels". This adapter assumes that A9 is sending an obfuscated CPM in their bid response, so Prebid cannot determine the winning bid on the client side. To handle this, the adapter sets the ad server targeting for amznslots to A9's bid response key value (which targets a specific line item). Prebid sets the amznslots key/value targeting on every call to the ad server, and the ad server selects the winning line item. In other words, the placement targeting and CPM optimization all happens server-side.

Hope this helps!

@kmjennison after reading and actually understanding the adapter more I understand this.

We have multiple ad 'sizes' from amazon at different CPM levels. Instead of hardcoding a base cpm I need to pass through the cpm with the ad tag code.

Something like


      bidObject = bidfactory.createBid(1);
      bidObject.bidderCode = 'amazon';
      bidObject.cpm =  bid.params.cpm; // Pass in the cpm corresponding to the ad id
      bidObject.ad = _getAmznAds()[key];
      bidObject.width = bid.params.width;
      bidObject.height = bid.params.height;

{
                bidder: 'amazon',
                params: {
                    amazonId: '1234',
                    width: 728,
                    height: 90,
                    size: 'a7x9p13',
                    cpm: 0.60
                }
            },
            {
                bidder: 'amazon',
                params: {
                    amazonId: '1234',
                    width: 728,
                    height: 90,
                    size: 'a7x9p14',
                    cpm: 0.50
                }
            }...

I'm sure that you can do that and it will work, but I'm not sure it will have the effect you want.

I don't know about other advertisers like amazon but some demand sees this redundant inventory and immediately drops their bid rate.

Amazon seems like they could have a system sophisticated enough that tiering is more of a headache than a yield mechanism.

@kmjennison have you had any success adapting your Amazon adaptor (no pun intended) to the new modular architecture of the latest version of Prebid? I attempted my own but it is behaving oddly (occasionally winning bids aren't sent to the ad server). Curious if anyone else out there had solved this.

@hhunter I haven't looked at it yet, because we're still on an older version of Prebid. If you share your adapter code, it's possible others here could help pinpoint any problems.

Hi @kmjennison It's been over a year since this thread, but just curious if you are still having success with your adapter. Any problems with Amazon?

@lospro7 I've stopped using this adapter since Prebid 1.0. I decided it would be tough to maintain and could break unexpectedly if Amazon changes their API.

Instead, we have a barebones request manager that loads Prebid and Amazon's bidder and makes the adserver request when both are complete (or if either times out). It's like a mini-Prebid. You can check out our implementation here.

It's unfortunate that A9 won't support a Prebid adapter, but this has worked okay for now.

@kmjennison thank you for your quick response and sharing code! Amazon is a pain to work with.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aszydlo picture aszydlo  路  6Comments

tpottersovrn picture tpottersovrn  路  5Comments

jdwieland8282 picture jdwieland8282  路  5Comments

eyedar picture eyedar  路  6Comments

matthewlane picture matthewlane  路  8Comments