Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CustomFunc ¶
CustomFunc is a function that preprocesses a response
func (CustomFunc) PreprocessResponse ¶
PreprocessResponse implements adsource.ResponsePreprocessor
type SecondPrice ¶
type SecondPrice struct{}
SecondPrice adjusts already-selected response bids to second-price (GSP) clearing.
Wire with adsource.WithResponsePreprocessor(preprocessors.SecondPrice{}).
Algorithm:
- Collect flat ads via IterAds and sort by InternalAuctionCPMBid descending.
- For each ad, clearing price is (in order): Second().GetPrice() if > 0, else the next ad's Price(ActionImpression), else the single/tail rule: - BidFloorCPM > 0 → BidFloor/1000 + half the gap to current (tail capped by min of other cleared prices) - no BidFloor, MinimumPrice > 0 → MinimumPrice - BidFloor and MinimumPrice both ≤ 0 → 10% of current, not above the previous (higher-ranked) ad's cleared price
- Apply via SetBidPrice(..., withCommission=true). Skip zero/negative.
func (SecondPrice) PreprocessResponse ¶
PreprocessResponse implements adsource.ResponsePreprocessor.
Click to show internal directories.
Click to hide internal directories.