Documentation ¶
Index ¶
- Constants
- func EventRequestToUrl(externalUrl string, request *analytics.EventRequest) string
- func FindCreatives(doc *etree.Document) []*etree.Element
- func GetVastUrlTracking(externalUrl string, bidid string, bidder string, accountId string, ...) string
- func GetVideoEventTracking(trackerURL string, bid *openrtb2.Bid, prebidGenBidId, requestingBidder string, ...) map[string]string
- func HandleAccountServiceErrors(errs []error) (status int, messages []string)
- func InjectVideoEventTrackers(trackerURL, vastXML string, bid *openrtb2.Bid, ...) ([]byte, bool, error)
- func ModifyVastXmlJSON(externalUrl string, data json.RawMessage, bidid, bidder, accountId string, ...) json.RawMessage
- func ModifyVastXmlString(externalUrl, vast, bidid, bidder, accountID string, timestamp int64, ...) (string, bool)
- func NewEventEndpoint(cfg *config.Configuration, accounts stored_requests.AccountFetcher, ...) httprouter.Handle
- func NewVTrackEndpoint(cfg *config.Configuration, accounts stored_requests.AccountFetcher, ...) httprouter.Handle
- func ParseEventRequest(r *http.Request) (*analytics.EventRequest, []error)
- type BidCacheRequest
- type BidCacheResponse
- type CacheObject
Constants ¶
const ( // Required TemplateUrl = "%v/event?t=%v&b=%v&a=%v" TypeParameter = "t" VTypeParameter = "vtype" BidIdParameter = "b" AccountIdParameter = "a" // Optional BidderParameter = "bidder" TimestampParameter = "ts" FormatParameter = "f" AnalyticsParameter = "x" IntegrationTypeParameter = "int" )
const ( AccountParameter = "a" IntegrationParameter = "int" ImpressionCloseTag = "</Impression>" ImpressionOpenTag = "<Impression>" )
const ( VASTAdTypeMacro = "[ADTYPE]" VASTAppBundleMacro = "[APPBUNDLE]" VASTDomainMacro = "[DOMAIN]" VASTPageURLMacro = "[PAGEURL]" // PBS specific macros PBSEventIDMacro = "[EVENT_ID]" // macro for injecting PBS defined video event tracker id //[PBS-ACCOUNT] represents publisher id / account id PBSAccountMacro = "[PBS-ACCOUNT]" // [PBS-BIDDER] represents bidder name PBSBidderMacro = "[PBS-BIDDER]" // [PBS-ORIG_BIDID] represents original bid id. PBSOrigBidIDMacro = "[PBS-ORIG_BIDID]" // [PBS-BIDID] represents bid id. If auction.generate-bid-id config is on, then resolve with response.seatbid.bid.ext.prebid.bidid. Else replace with response.seatbid.bid.id PBSBidIDMacro = "[PBS-BIDID]" // [ADERVERTISER_NAME] represents advertiser name PBSAdvertiserNameMacro = "[ADVERTISER_NAME]" // Pass imp.tagId using this macro PBSAdUnitIDMacro = "[AD_UNIT]" //PBSBidderCodeMacro represents an alias id or core bidder id. PBSBidderCodeMacro = "[BIDDER_CODE]" )
standard VAST macros https://interactiveadvertisingbureau.github.io/vast/vast4macros/vast4-macros-latest.html#macro-spec-adcount
Variables ¶
This section is empty.
Functions ¶
func EventRequestToUrl ¶
func EventRequestToUrl(externalUrl string, request *analytics.EventRequest) string
EventRequestToUrl converts an analytics.EventRequest to an URL
func FindCreatives ¶
FindCreatives finds Linear, NonLinearAds fro InLine and Wrapper Type of creatives from input doc - VAST Document NOTE: This function is temporarily seperated to reuse in ctv_auction.go. Because, in case of ctv we generate bid.id
func GetVastUrlTracking ¶
func GetVastUrlTracking(externalUrl string, bidid string, bidder string, accountId string, timestamp int64, integration string) string
GetVastUrlTracking creates a vast url tracking
func GetVideoEventTracking ¶
func GetVideoEventTracking(trackerURL string, bid *openrtb2.Bid, prebidGenBidId, requestingBidder string, bidderCoreName string, accountId string, timestamp int64, req *openrtb2.BidRequest, doc *etree.Document, impMap map[string]*openrtb2.Imp) map[string]string
GetVideoEventTracking returns map containing key as event name value as associaed video event tracking URL By default PBS will expect [EVENT_ID] macro in trackerURL to inject event information [EVENT_ID] will be injected with one of the following values
firstQuartile, midpoint, thirdQuartile, complete
If your company can not use [EVENT_ID] and has its own macro. provide config.TrackerMacros implementation and ensure that your macro is part of trackerURL configuration
func HandleAccountServiceErrors ¶
HandleAccountServiceErrors handles account.GetAccount errors
func InjectVideoEventTrackers ¶
func InjectVideoEventTrackers(trackerURL, vastXML string, bid *openrtb2.Bid, prebidGenBidId, requestingBidder, bidderCoreName, accountID string, timestamp int64, bidRequest *openrtb2.BidRequest) ([]byte, bool, error)
InjectVideoEventTrackers injects the video tracking events Returns VAST xml contains as first argument. Second argument indicates whether the trackers are injected and last argument indicates if there is any error in injecting the trackers
func ModifyVastXmlJSON ¶
func ModifyVastXmlJSON(externalUrl string, data json.RawMessage, bidid, bidder, accountId string, timestamp int64, integrationType string) json.RawMessage
ModifyVastXmlJSON modifies BidCacheRequest element Vast XML data
func ModifyVastXmlString ¶
func ModifyVastXmlString(externalUrl, vast, bidid, bidder, accountID string, timestamp int64, integrationType string) (string, bool)
ModifyVastXmlString rewrites and returns the string vastXML and a flag indicating if it was modified
func NewEventEndpoint ¶
func NewEventEndpoint(cfg *config.Configuration, accounts stored_requests.AccountFetcher, analytics analytics.PBSAnalyticsModule) httprouter.Handle
func NewVTrackEndpoint ¶
func NewVTrackEndpoint(cfg *config.Configuration, accounts stored_requests.AccountFetcher, cache prebid_cache_client.Client, bidderInfos config.BidderInfos) httprouter.Handle
func ParseEventRequest ¶
func ParseEventRequest(r *http.Request) (*analytics.EventRequest, []error)
ParseEventRequest parses an analytics.EventRequest from an Http request
Types ¶
type BidCacheRequest ¶
type BidCacheRequest struct {
Puts []prebid_cache_client.Cacheable `json:"puts"`
}
func ParseVTrackRequest ¶
func ParseVTrackRequest(httpRequest *http.Request, maxRequestSize int64) (req *BidCacheRequest, err error)
ParseVTrackRequest parses a BidCacheRequest from an HTTP Request
type BidCacheResponse ¶
type BidCacheResponse struct {
Responses []CacheObject `json:"responses"`
}
type CacheObject ¶
type CacheObject struct {
UUID string `json:"uuid"`
}