events

package
v1.200.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
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"
)
View Source
const (
	AccountParameter     = "a"
	IntegrationParameter = "int"
	ImpressionCloseTag   = "</Impression>"
	ImpressionOpenTag    = "<Impression>"
)
View Source
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

func FindCreatives(doc *etree.Document) []*etree.Element

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

func HandleAccountServiceErrors(errs []error) (status int, messages []string)

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 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"`
}

Jump to

Keyboard shortcuts

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