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

Facebook AudienceNetwork mobile web bidder returning status 400 error #1092

Closed
andyblackwell opened this issue Oct 29, 2019 · 16 comments
Closed

Comments

@andyblackwell
Copy link

For mobile web calls to audienceNetwork, the adapter is returning 400 errors. In looking at the debug output sent to the appnexus prebid server, it seems the only difference I noticed to other bid requests is that the audienceNetwork request body ends in a new line.

I don't know if this is the actual reason for the 400 response, but if so it's probably because the adapter is using json.NewEncoder (which appends a new line), vs json.Marshal which is used by other adapters and does not append a new line
https://github.com/prebid/prebid-server/blob/0.86.0/adapters/audienceNetwork/facebook.go#L223

here's example debug output, I removed the other bidders here to reduce noise:

{
    "targeting": {},
    "debug": {
        "httpcalls": {
            "audienceNetwork": [{
                "uri": "https://an.facebook.com/placementbid.ortb",
                "requestbody": "{\"id\":\"b9c97a4b-cbc4-483d-b2c4-58a19ed5cfc5\",\"imp\":[{\"id\":\"cb_amp_eb_300x250\",\"banner\":{\"format\":[{\"w\":300,\"h\":250}],\"w\":300,\"h\":250},\"tagid\":\"1995140980753520_2428735337394080\",\"secure\":1}],\"site\":{\"domain\":\"www.cinemablend.com\",\"page\":\"https://www.cinemablend.com/news/2475160/men-in-black-international-reportedly-had-some-serious-behind-the-scenes-drama\",\"publisher\":{\"id\":\"1995140980753520\"}},\"device\":{\"ua\":\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36\",\"ip\":\"209.116.32.50\"},\"user\":{},\"at\":1,\"tmax\":1000,\"source\":{\"fd\":1,\"tid\":\"b9c97a4b-cbc4-483d-b2c4-58a19ed5cfc5\"},\"ext\":{\"platformid\":442648859414574}}\n",
                "responsebody": "",
                "status": 400
            }]
        },
        "resolvedrequest": {
            "id": "cb_amp_eb_300x250",
            "imp": [{
                "id": "cb_amp_eb_300x250",
                "banner": {
                    "format": [{
                        "w": 300,
                        "h": 250
                    }]
                },
                "tagid": "/118772816/cb_amp_eb_300x250",
                "secure": 1,
                "ext": {
                    "audienceNetwork": {
                        "placementId": "1995140980753520_2428735337394080"
                    }
                }
            }],
            "site": {
                "domain": "www.cinemablend.com",
                "page": "https://www.cinemablend.com/news/2475160/men-in-black-international-reportedly-had-some-serious-behind-the-scenes-drama",
                "publisher": {
                    "id": "28df1f1e-bfc2-466b-94e1-31e92ffe1a21"
                },
                "ext": {
                    "amp": 1
                }
            },
            "device": {
                "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.70 Safari/537.36",
                "ip": "209.116.32.50"
            },
            "test": 1,
            "at": 1,
            "tmax": 1000,
            "source": {
                "tid": "b9c97a4b-cbc4-483d-b2c4-58a19ed5cfc5"
            },
            "ext": {
                "prebid": {
                    "cache": {
                        "bids": {},
                        "vastxml": null
                    },
                    "targeting": {
                        "pricegranularity": {
                            "precision": 2,
                            "ranges": [{
                                "min": 0,
                                "max": 20,
                                "increment": 0.1
                            }]
                        },
                        "includewinners": true,
                        "includebidderkeys": true,
                        "includebrandcategory": null,
                        "durationrangesec": null
                    }
                }
            }
        }
    },
    "errors": {
        "audienceNetwork": [{
            "code": 2,
            "message": "HTTP status 400; body: "
        }]
    }
}
@bretg
Copy link
Contributor

bretg commented Nov 4, 2019

Ok, looking for someone who can fix this. @lovell perhaps?

@lovell
Copy link

lovell commented Nov 5, 2019

I'm unable to help with this, sorry.

@bretg
Copy link
Contributor

bretg commented Nov 6, 2019

Ok. Looking for a community volunteer to address this. There's no owner for this adapter.

@andyblackwell
Copy link
Author

I attempted to get the server up and running locally, but only get 404's on the auction endpoints. I'd be game for contributing if I could get it running properly.

@stale
Copy link

stale bot commented Nov 14, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 14, 2019
@andyblackwell
Copy link
Author

bump to un-stale

@stale stale bot removed the stale label Nov 18, 2019
@stale
Copy link

stale bot commented Nov 25, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 25, 2019
@SyntaxNode SyntaxNode added bug and removed stale labels Nov 27, 2019
@hhhjort
Copy link
Collaborator

hhhjort commented Jan 13, 2020

Testing this in postman, the call to facebook returns 400 with or without the trailing new line. Trying to dig in deeper.

Oh I see, there is no user data, and facebook requires a user match in order to bid. Will try to dig up a user ID to see if that resolves the issue. PR #1064 recoded to the adapter to require user.buyerid and return an error if it is missing. That should resolve the issue, but if I can find a valid facebook UID I will test the above request to verify that it was the only thing wrong with it.

@andyblackwell
Copy link
Author

ok, if that does end up being the problem let me know how to resolve, especially from like an AMP call.

you can get your own Facebook UID by either:

@andyblackwell
Copy link
Author

Also, I was getting this error back on Oct 29, 2019 (before the refactor) in case that changes what you're looking for

@hhhjort
Copy link
Collaborator

hhhjort commented Jan 15, 2020

No. The missing UID definitely explains what is going on. Just wanted to rule out additional issues. Unfortunately neither above methods work for me as I am not a facebook developer nor do I have a facebook account.

After the refactor the adapter will return an error explaining that it needs the UID in order to submit a request to facebook. And the facebook endpoint will return status 400 if there are no bids for any reason, even if the request was perfectly valid, but facebook just didn't care to bid at this time.

@andyblackwell
Copy link
Author

andyblackwell commented Jan 15, 2020

Ok, the only references to buyeruid I've found is in their App Bidding docs:
https://developers.facebook.com/docs/audience-network/mapp-bidding-best-practices

Since you need to get that buyeruid from their native sdk, I'm assuming this means audience network only supports native app bidding for prebid server, and not normal web requests like from AMP

@hhhjort
Copy link
Collaborator

hhhjort commented Jan 15, 2020

buyeruid is the openrtb2 name, not a facebook specific thing. The facebook UID goes into buyeruid when the adapter sends it to facebook.

@andyblackwell
Copy link
Author

ok, but are you able to verify or not that their server adapter is supposed to work for normal web requests?

Because it's sounding like we're supposed to send a facebook user id from the client side, and that's just not something that's done on normal web requests. Which is why I'm assuming their adapter is only meant for native app bidding requests, and not normal web.

@hhhjort
Copy link
Collaborator

hhhjort commented Jan 15, 2020

I don't have the IDs to test with, but the adapter claims that web requests are valid.

@andyblackwell
Copy link
Author

given that Facebook announced the other day that they are retiring audience network for web requests, and will only be supporting app bidding, guess I'll be closing this ticket 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants