Skip to content

Stop sending app.content to Meta - #135

Merged
zwl-williamzha merged 1 commit into
msp-2506from
fb-drop-app-content
Aug 28, 2026
Merged

Stop sending app.content to Meta#135
zwl-williamzha merged 1 commit into
msp-2506from
fb-drop-app-content

Conversation

@zwl-williamzha

Copy link
Copy Markdown

What

Drop app.content from the bid request the audienceNetwork adapter sends to Meta.

MSP's document module fills app.content.url with the canonical article URL (www.newsbreak.com/n/{doc_id}, or the app's base URL on non-article slots) so bidders get a contextual signal. Meta should not receive it.

	if out.App != nil {
		app := *out.App
		app.Publisher = &openrtb2.Publisher{ID: pubId}
		// Meta does not get the article URL MSP puts on app.content.
		app.Content = nil
		out.App = &app
	}

Why here

modifyRequest already shallow-copies App per outgoing request in order to overwrite Publisher, which makes it the one safe place to edit it. The auction's App pointer is shared across bidder goroutines — ortb.CloneBidRequestPartial deep-copies only Device, User and Source — so stripping it anywhere upstream (an MSP wrapper adapter or a bidder-request hook) would also strip it from Google/Nova/Moloco and race with them. Nil'ing the copy leaves every other seat untouched.

It also covers both Meta paths in MSP in one place: the plain audienceNetwork seat (9 stored imps) and the msp_fb_* aliases (341), which build from this same Builder via pkg/adapters/fb/core.go.

app.content is MSP-generated and holds only the URL, so nil'ing the object drops nothing else in practice.

Test

New exemplary fixture banner-app-content.json: mock request carries app.content.url and app.domain, expected outgoing body keeps domain and drops content — so it pins "only content goes, the rest of app stays." TestJsonSamples picks it up from the directory automatically.

go test ./adapters/audienceNetwork/... passes; with the two lines reverted the new fixture fails on the "content" diff.

🤖 Generated with Claude Code

MSP's document module fills app.content.url with the canonical article URL
(www.newsbreak.com/n/{doc_id}) so bidders get a contextual signal. Meta should
not receive it, so drop app.content on the way out of the audienceNetwork
adapter.

modifyRequest already shallow-copies App per outgoing request to overwrite
Publisher, so nil'ing Content there is safe: the auction's App is shared
across bidder goroutines (ortb.CloneBidRequestPartial deep-copies only Device,
User and Source), and every other seat keeps the URL.

This covers both Meta paths in MSP -- the plain audienceNetwork seat and the
msp_fb_* aliases, which build from this same Builder.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@zwl-williamzha
zwl-williamzha merged commit ad5ae87 into msp-2506 Aug 28, 2026
1 check passed
@zwl-williamzha
zwl-williamzha deleted the fb-drop-app-content branch August 28, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants