Documentation ¶
Index ¶
- type APIClientRequest
- type APIClientResponse
- type APIOptions
- type ActivationHit
- type BaseHit
- type BatchHit
- type Campaign
- type ClientVariation
- type Context
- type Event
- type EventHit
- type EventType
- type FlagInfos
- type HitInterface
- type HitType
- type ItemHit
- type Modification
- type PageHit
- type ScreenHit
- type TransactionHit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClientRequest ¶
type APIClientRequest struct { VisitorID string `json:"visitor_id"` Context map[string]interface{} `json:"context"` TriggerHit bool `json:"trigger_hit"` }
APIClientRequest represents the API client informations
type APIClientResponse ¶
type APIClientResponse struct { VisitorID string `json:"visitorId"` Panic bool `json:"panic"` Campaigns []Campaign `json:"campaigns"` }
APIClientResponse represents a decision response
type APIOptions ¶
APIOptions represents the options for the Decision API Client
type ActivationHit ¶
type ActivationHit struct { VisitorID string `json:"vid"` EnvironmentID string `json:"cid"` VariationGroupID string `json:"caid"` VariationID string `json:"vaid"` CreatedAt time.Time `json:"-"` QueueTime int64 `json:"-"` }
ActivationHit represents an item hit for the datacollect
func (*ActivationHit) ComputeQueueTime ¶
func (b *ActivationHit) ComputeQueueTime()
ComputeQueueTime computes hit queue time
func (*ActivationHit) SetBaseInfos ¶
func (b *ActivationHit) SetBaseInfos(envID string, visitorID string)
SetBaseInfos sets the mandatory information for the hit
func (*ActivationHit) Validate ¶
func (b *ActivationHit) Validate() []error
Validate checks that the hit is well formed
type BaseHit ¶
type BaseHit struct { VisitorID string `json:"vid,omitempty"` EnvironmentID string `json:"cid,omitempty"` Type HitType `json:"t,omitempty"` DataSource string `json:"ds,omitempty"` ProtocolVersion string `json:"v,omitempty"` UserIP string `json:"uip,omitempty"` DocumentReferrer string `json:"dr,omitempty"` ViewportSize string `json:"vp,omitempty"` ScreenResolution string `json:"sr,omitempty"` PageTitle string `json:"pt,omitempty"` DocumentEncoding string `json:"de,omitempty"` ScreenColorDepth string `json:"sd,omitempty"` UserLanguage string `json:"ul,omitempty"` JavaEnabled *bool `json:"je,omitempty"` FlashVersion string `json:"fl,omitempty"` QueueTime int64 `json:"qt,omitempty"` DocumentLocation string `json:"dl,omitempty"` CurrentSessionTimestamp int64 `json:"cst,omitempty"` SessionNumber int64 `json:"sn,omitempty"` CreatedAt time.Time `json:"-"` }
BaseHit represents the API client informations
func (*BaseHit) ComputeQueueTime ¶
func (b *BaseHit) ComputeQueueTime()
ComputeQueueTime computes hit queue time
func (*BaseHit) SetBaseInfos ¶
SetBaseInfos sets the mandatory information for the hit
type BatchHit ¶
type BatchHit struct { BaseHit Hits []HitInterface `json:"h"` }
BatchHit represents a batch of hits for the datacollect
func (*BatchHit) AddHit ¶
func (b *BatchHit) AddHit(hit HitInterface)
AddHit adds a hit to the batch
func (*BatchHit) SetBaseInfos ¶
SetBaseInfos sets the mandatory information for the hit
type Campaign ¶
type Campaign struct { ID string `json:"id"` VariationGroupID string `json:"variationGroupId"` Variation ClientVariation `json:"variation"` }
Campaign represents a decision campaign
type ClientVariation ¶
type ClientVariation struct { ID string `json:"id"` Modifications Modification `json:"modifications"` Reference bool `json:"reference"` }
ClientVariation represents a decision campaign variation
type Event ¶
type Event struct { VisitorID string `json:"visitorId"` Type EventType `json:"type"` Data Context `json:"data"` CreatedAt time.Time `json:"-"` QueueTime int64 `json:"-"` }
Event represents a context event hit for Flagship
func (*Event) ComputeQueueTime ¶
func (b *Event) ComputeQueueTime()
ComputeQueueTime computes hit queue time
func (*Event) SetBaseInfos ¶
SetBaseInfos sets the mandatory information for the hit
type EventHit ¶
type EventHit struct { BaseHit Action string `json:"ea"` Category string `json:"ec,omitempty"` Label string `json:"el,omitempty"` Value int64 `json:"ev,omitempty"` }
EventHit represents an event hit for the datacollect
func (*EventHit) SetBaseInfos ¶
SetBaseInfos sets the mandatory information for the hit
type EventType ¶
type EventType string
EventType express the type of the event
const (
CONTEXT EventType = "CONTEXT"
)
The different event types
type FlagInfos ¶
type FlagInfos struct { Value interface{} Campaign Campaign }
FlagInfos represents a decision campaign variation modification
type HitInterface ¶
type HitInterface interface { Validate() []error SetBaseInfos(envID string, visitorID string) ComputeQueueTime() }
HitInterface express the interface for the hits
type ItemHit ¶
type ItemHit struct { BaseHit TransactionID string `json:"tid"` Name string `json:"in"` Price float64 `json:"ip,omitempty"` Quantity int `json:"iq,omitempty"` Code string `json:"ic,omitempty"` Category string `json:"iv,omitempty"` }
ItemHit represents an item hit for the datacollect
func (*ItemHit) SetBaseInfos ¶
SetBaseInfos sets the mandatory information for the hit
type Modification ¶
Modification represents a decision campaign variation modification
type PageHit ¶
type PageHit struct {
BaseHit
}
PageHit represents a pageview hit for the datacollect
func (*PageHit) SetBaseInfos ¶
SetBaseInfos sets the mandatory information for the hit
type ScreenHit ¶ added in v2.0.6
type ScreenHit struct {
BaseHit
}
ScreenHit represents a screenview hit for the datacollect
func (*ScreenHit) SetBaseInfos ¶ added in v2.0.6
SetBaseInfos sets the mandatory information for the hit
type TransactionHit ¶
type TransactionHit struct { BaseHit TransactionID string `json:"tid"` Affiliation string `json:"ta"` Revenue float64 `json:"tr,omitempty"` Shipping float64 `json:"ts,omitempty"` Tax float64 `json:"tt,omitempty"` Currency string `json:"tc,omitempty"` CouponCode string `json:"tcc,omitempty"` PaymentMethod string `json:"pm,omitempty"` ShippingMethod string `json:"sm,omitempty"` ItemCount int `json:"icn,omitempty"` }
TransactionHit represents a transaction hit for the datacollect
func (*TransactionHit) SetBaseInfos ¶
func (b *TransactionHit) SetBaseInfos(envID string, visitorID string)
SetBaseInfos sets the mandatory information for the hit
func (*TransactionHit) Validate ¶
func (b *TransactionHit) Validate() []error
Validate checks that the hit is well formed