adresponse

package
v0.0.0-...-7313b4a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BidResponse

type BidResponse struct {

	// Request and source information
	Req *adtype.BidRequest
	Src adtype.Source

	// BidResponse RTB record
	BidResponse openrtb.BidResponse
	// contains filtered or unexported fields
}

BidResponse RTB record

func (*BidResponse) Ads

Ads list

func (*BidResponse) AuctionID

func (r *BidResponse) AuctionID() string

AuctionID response

func (*BidResponse) AuctionType

func (r *BidResponse) AuctionType() types.AuctionType

AuctionType of request

func (*BidResponse) Context

func (r *BidResponse) Context(ctx ...context.Context) context.Context

Context of response

func (*BidResponse) Count

func (r *BidResponse) Count() int

Count bids

func (*BidResponse) Error

func (r *BidResponse) Error() error

Error of the response

func (*BidResponse) Get

func (r *BidResponse) Get(key string) any

Get context value

func (*BidResponse) Item

Item by impression code

func (*BidResponse) OptimalBids

func (r *BidResponse) OptimalBids() []*openrtb.Bid

OptimalBids list (the most expensive)

func (*BidResponse) Prepare

func (r *BidResponse) Prepare()

Prepare bid response

func (*BidResponse) Release

func (r *BidResponse) Release()

Release response and all linked objects

func (*BidResponse) Request

func (r *BidResponse) Request() *adtype.BidRequest

Request information

func (*BidResponse) Source

func (r *BidResponse) Source() adtype.Source

Source of response

func (*BidResponse) Validate

func (r *BidResponse) Validate() error

Validate response

type ResponseBidItem

type ResponseBidItem struct {
	ItemID string `json:"id"`

	// Request and impression data
	Src adtype.Source      `json:"source,omitempty"`
	Req *adtype.BidRequest `json:"request,omitempty"`
	Imp *adtype.Impression `json:"impression,omitempty"`

	// Format of response advertisement item
	FormatType types.FormatType `json:"format_type,omitempty"`
	RespFormat *types.Format    `json:"format,omitempty"`

	// External response data from RTB source
	Bid        *openrtb.Bid      `json:"bid,omitempty"`
	Native     *natresp.Response `json:"native,omitempty"`
	ActionLink string            `json:"action_link,omitempty"`

	PriceScope price.PriceScopeView `json:"price_scope,omitempty"`

	// Competitive second AD
	SecondAd adtype.SecondAd `json:"second_ad,omitempty"`

	Data map[string]any `json:"data,omitempty"`
	// contains filtered or unexported fields
}

ResponseBidItem value

func (*ResponseBidItem) AccountID

func (it *ResponseBidItem) AccountID() uint64

AccountID returns the account ID of the source

func (*ResponseBidItem) ActionURL

func (it *ResponseBidItem) ActionURL() string

ActionURL for direct ADS

func (*ResponseBidItem) AdCreativeID

func (it *ResponseBidItem) AdCreativeID() string

AdCreativeID of the external advertisement

func (*ResponseBidItem) AdID

func (it *ResponseBidItem) AdID() uint64

AdID returns the advertisement ID of the system

func (*ResponseBidItem) Assets

func (it *ResponseBidItem) Assets() (assets admodels.AdAssets)

Assets returns list of the advertisement

func (*ResponseBidItem) BidPrice

func (it *ResponseBidItem) BidPrice() billing.Money

BidPrice returns bid price for the external auction source. The current bid price will be adjusted according to the source correction factor and the commission share factor

func (*ResponseBidItem) CampaignID

func (it *ResponseBidItem) CampaignID() uint64

CampaignID returns the campaign ID of the system

func (it *ResponseBidItem) ClickTrackerLinks() []string

ClickTrackerLinks returns third-party tracker URLs to be fired on click of the URL

func (*ResponseBidItem) CommissionShareFactor

func (it *ResponseBidItem) CommissionShareFactor() float64

CommissionShareFactor which system get from publisher 0..1

func (*ResponseBidItem) ContentFields

func (it *ResponseBidItem) ContentFields() map[string]any

ContentFields from advertisement object

func (*ResponseBidItem) ContentItem

func (it *ResponseBidItem) ContentItem(name string) any

ContentItem returns the ad response data

func (*ResponseBidItem) ContentItemString

func (it *ResponseBidItem) ContentItemString(name string) string

ContentItemString from the ad

func (*ResponseBidItem) Context

func (it *ResponseBidItem) Context(ctx ...context.Context) context.Context

Context value

func (*ResponseBidItem) ECPM

func (it *ResponseBidItem) ECPM() billing.Money

ECPM returns the effective cost per mille

func (*ResponseBidItem) ExtImpressionID

func (it *ResponseBidItem) ExtImpressionID() string

ExtImpressionID unique code of RTB response

func (*ResponseBidItem) ExtTargetID

func (it *ResponseBidItem) ExtTargetID() string

ExtTargetID of the external network

func (*ResponseBidItem) FinalPrice

func (it *ResponseBidItem) FinalPrice(action admodels.Action) billing.Money

FinalPrice for the action with all corrections and commissions

func (*ResponseBidItem) FixedPurchasePrice

func (it *ResponseBidItem) FixedPurchasePrice(action admodels.Action) billing.Money

FixedPurchasePrice returns the fixed price of the action

func (*ResponseBidItem) Format

func (it *ResponseBidItem) Format() *types.Format

Format object model

func (*ResponseBidItem) Get

func (it *ResponseBidItem) Get(key string) (res any)

Get ext field

func (*ResponseBidItem) Height

func (it *ResponseBidItem) Height() int

Height of item

func (*ResponseBidItem) ID

func (it *ResponseBidItem) ID() string

ID of current response item (unique code of current response)

func (*ResponseBidItem) Impression

func (it *ResponseBidItem) Impression() *adtype.Impression

Impression place object

func (*ResponseBidItem) ImpressionID

func (it *ResponseBidItem) ImpressionID() string

ImpressionID unique code string

func (*ResponseBidItem) InternalAuctionCPMBid

func (it *ResponseBidItem) InternalAuctionCPMBid() billing.Money

InternalAuctionCPMBid value provides maximal possible price without any commission According to this value the system can choice the best item for the auction

func (*ResponseBidItem) IsBackup

func (it *ResponseBidItem) IsBackup() bool

IsBackup indicates whether the advertisement is a backup ad type.

func (*ResponseBidItem) IsDirect

func (it *ResponseBidItem) IsDirect() bool

IsDirect AD format

func (*ResponseBidItem) MainAsset

func (it *ResponseBidItem) MainAsset() *admodels.AdAsset

MainAsset from response

func (*ResponseBidItem) Markup

func (it *ResponseBidItem) Markup() (string, error)

Markup advertisement

func (*ResponseBidItem) NetworkName

func (it *ResponseBidItem) NetworkName() string

NetworkName by source

func (*ResponseBidItem) PotentialPrice

func (it *ResponseBidItem) PotentialPrice(action admodels.Action) billing.Money

PotentialPrice wich can be received from source but was marked as descrepancy

func (*ResponseBidItem) Price

func (it *ResponseBidItem) Price(action admodels.Action) billing.Money

Price for specific action if supported `click`, `lead`, `view` returns total price of the action

func (*ResponseBidItem) PriceTestMode

func (it *ResponseBidItem) PriceTestMode() bool

PriceTestMode returns true if the price is in test mode

func (*ResponseBidItem) PricingModel

func (it *ResponseBidItem) PricingModel() types.PricingModel

PricingModel of advertisement In case of RTB it can be CPM only

func (*ResponseBidItem) PriorityFormatType

func (it *ResponseBidItem) PriorityFormatType() types.FormatType

PriorityFormatType from current Ad

func (*ResponseBidItem) PurchasePrice

func (it *ResponseBidItem) PurchasePrice(action admodels.Action) billing.Money

PurchasePrice gives the price of view from external resource. The cost of this request for the system.

func (*ResponseBidItem) RTBCategories

func (it *ResponseBidItem) RTBCategories() []string

RTBCategories of the advertisement

func (*ResponseBidItem) Second

func (it *ResponseBidItem) Second() *adtype.SecondAd

Second campaigns

func (*ResponseBidItem) SetAuctionCPMBid

func (it *ResponseBidItem) SetAuctionCPMBid(price billing.Money, includeFactors ...adtype.PriceFactor) error

SetAuctionCPMBid value for external sources auction the system will pay

func (*ResponseBidItem) SetBidPrice

func (it *ResponseBidItem) SetBidPrice(bid billing.Money) error

SetBidPrice value for external sources auction the system will pay

func (*ResponseBidItem) Source

func (it *ResponseBidItem) Source() adtype.Source

Source of response

func (*ResponseBidItem) SourceCorrectionFactor

func (it *ResponseBidItem) SourceCorrectionFactor() float64

SourceCorrectionFactor value for the source

func (*ResponseBidItem) TargetCorrectionFactor

func (it *ResponseBidItem) TargetCorrectionFactor() float64

TargetCorrectionFactor value for the target

func (*ResponseBidItem) Validate

func (it *ResponseBidItem) Validate() error

Validate item

func (it *ResponseBidItem) ViewTrackerLinks() []string

ViewTrackerLinks returns traking links for view action

func (*ResponseBidItem) Width

func (it *ResponseBidItem) Width() int

Width of item

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL