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

Bidder-defined TTL #1386

Closed
Aigolkin1991 opened this issue Jul 8, 2020 · 10 comments
Closed

Bidder-defined TTL #1386

Aigolkin1991 opened this issue Jul 8, 2020 · 10 comments
Assignees

Comments

@Aigolkin1991
Copy link

I'm looking for way to set TTL inside our adapter for bid.adm (banner,video,native separate) - this is important for our demand source, which have TTL for win and imp events. Currently we are getting discrepancy between supply source and demand in number of impressions, this occurs when adm is being rendered after impression record on our demand side has been already timed out, in this case only supply partner counts impression

@bretg
Copy link
Contributor

bretg commented Jul 16, 2020

Here's a cut at a technical description:

  1. bidders can set seatbid.bid.exp in seconds
  2. this value is passed back to clients who should respect it
  3. if present, this value is used as the cache TTL for Prebid Cache instead of the account-level TTL or the default TTL
    3a) covers scenarios of both bid-cache (AMP and Mobile) and VAST XML (Video)

Will that cover it?

@bretg bretg changed the title Bid response Adm (bid) TTL Bid response TTL Jul 16, 2020
@bretg bretg self-assigned this Jul 16, 2020
@bretg bretg changed the title Bid response TTL Bidder-defined TTL Jul 16, 2020
@patmmccann
Copy link
Contributor

appears to be a duplicate of #237

@Aigolkin1991
Copy link
Author

appears to be a duplicate of #237

Nope, proposition which you are talking about is about setting TTL from supply side (Prebid.js), my question is about setting TTL from demand side. @bretg gave the answer which i was looking for

@bretg bretg reopened this Jul 18, 2020
@bretg
Copy link
Contributor

bretg commented Jul 18, 2020

Wait, this feature isn't implemented yet - my description was a more detailed feature proposal.

@SyntaxNode
Copy link
Contributor

SyntaxNode commented Jul 24, 2020

Discussed by Prebid Server Committee.

Support was added in PrebidJS in prebid/Prebid.js#5419 to look in the seatbid.bid.ttl field. Unless we're misunderstanding the PBJS object model, that field is not defined in OpenRTB 2.5. PBS is using third party libraries for the OpenRTB spec and can only extend the spec via the defined ext fields. With this clarification, seatbid.bid.exp is fine.. but support needs to be added to PrebidJS.

@bretg
Copy link
Contributor

bretg commented Aug 4, 2020

I believe you're saying is that prebid/Prebid.js#5419 was incorrect -- seatbid.bid.ttl will never be set by PBS.

So in addition to the steps described in my comment above, we ought to go back and change PBJS to look for exp instead of ttl.

@bretg
Copy link
Contributor

bretg commented Aug 4, 2020

@rpanchyk has pointed out that PBS-Java already looks for seatbid.bid.exp.

PBS-Go does too, but adds a 60-second buffer and uses the lower of the request.imp.exp and response.seatbid.bid.exp

exchange/auction.go
TTLSeconds: cacheTTL(expByImp[impID], topBidPerBidder.bid.Exp, defTTL(topBidPerBidder.bidType, defaultTTLs), ttlBuffer),

func cacheTTL(impTTL int64, bidTTL int64, defTTL int64, buffer int64) (ttl int64) {
	if impTTL <= 0 && bidTTL <= 0 {
		// Only use default if there is no imp nor bid TTL provided. We don't want the default
		// to cut short a requested longer TTL.
		return addBuffer(defTTL, buffer)
	}
	if impTTL <= 0 {
		// Use <= to handle the case of someone sending a negative ttl. We treat it as zero
		return addBuffer(bidTTL, buffer)
	}
	if bidTTL <= 0 {
		return addBuffer(impTTL, buffer)
	}
	if impTTL < bidTTL {
		return addBuffer(impTTL, buffer)
	}
	return addBuffer(bidTTL, buffer)
}

So I'd suggest two things here:

  1. PBS-Java could align better with PBS-Go
  2. PBJS needs to change

other than that, we're good here? Bid adapters can already set bidresponse.exp and it will be respected.

@stale
Copy link

stale bot commented Sep 5, 2020

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.

@SyntaxNode
Copy link
Contributor

@bretg Did the change to Prebid.js resolve this thread?

@stale stale bot removed the stale label Sep 12, 2020
@bretg
Copy link
Contributor

bretg commented Sep 25, 2020

@Aigolkin1991 - we believe this is adequately resolved now, except perhaps in bid adapter developer documentation. Just set the exp attribute on the bidResponse.

@bretg bretg closed this as completed Sep 25, 2020
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

4 participants