github.com/prebid/prebid-server/v2@v2.18.0/analytics/event.go (about)

     1  package analytics
     2  
     3  // EventType enumerates the values of events Prebid Server can receive for an ad.
     4  type EventType string
     5  
     6  // Possible values of events Prebid Server can receive for an ad.
     7  const (
     8  	Win  EventType = "win"
     9  	Imp  EventType = "imp"
    10  	Vast EventType = "vast"
    11  )
    12  
    13  // ResponseFormat enumerates the values of a Prebid Server event.
    14  type ResponseFormat string
    15  
    16  const (
    17  	// Blank describes an event which returns an HTTP 200 with an empty body.
    18  	Blank ResponseFormat = "b"
    19  	// Image describes an event which returns an HTTP 200 with a PNG body.
    20  	Image ResponseFormat = "i"
    21  )
    22  
    23  // VastType enumerates the values of vast type events Prebid Server can receive
    24  type VastType string
    25  
    26  // Possible value of VastType event prebid server can receive.
    27  const (
    28  	Start         VastType = "start"
    29  	FirstQuartile VastType = "firstQuartile"
    30  	MidPoint      VastType = "midPoint"
    31  	ThirdQuartile VastType = "thirdQuartile"
    32  	Complete      VastType = "complete"
    33  )
    34  
    35  // Analytics indicates if the notification event should be handled or not
    36  type Analytics string
    37  
    38  const (
    39  	Enabled  Analytics = "1"
    40  	Disabled Analytics = "0"
    41  )
    42  
    43  type EventRequest struct {
    44  	Type        EventType      `json:"type,omitempty"`
    45  	Format      ResponseFormat `json:"format,omitempty"`
    46  	Analytics   Analytics      `json:"analytics,omitempty"`
    47  	BidID       string         `json:"bidid,omitempty"`
    48  	AccountID   string         `json:"account_id,omitempty"`
    49  	Bidder      string         `json:"bidder,omitempty"`
    50  	Timestamp   int64          `json:"timestamp,omitempty"`
    51  	Integration string         `json:"integration,omitempty"`
    52  	VType       VastType       `json:"vtype,omitempty"`
    53  }