Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidClientKey is returned when the client key was not accepted by forensiq ErrInvalidClientKey = errors.New("the client key was not accepted by forensiq") )
Functions ¶
This section is empty.
Types ¶
type CheckRequest ¶
type CheckRequest struct { // IP is the visitor’s IP address. Required. IP net.IP // RequestType based on where the call is performed. Possible values are // click or display. Required RequestType string // URL is the URL where the ad is placed. Optional URL string // SellerID is the ID you assign to your traffic sources/publishers. // Required SellerID string // SubID is the sub source or placement ID. Optional SubID string // Campaign is the campaign or creative ID. Optional Campaign string // UserAgent is user-agent string captured from the http headers passed by // the browser. Optional UserAgent string // CookieID is the id representing the user of the request. CookieID string }
CheckRequest represents a request to the Forensiq API
type CheckResponse ¶
type CheckResponse struct { // RiskScore represents the likelihood that an impression is fraudulent. RiskScore int `json:"riskScore"` // SellerDomain represents the ratio of impressions with riskScore of 65 or // above for a specified seller-domain combination. SellerDomain int `json:"sellerDomain"` // DomainViewed represents the ratio of ads viewed grouped by domain, // ranging from 0 (no ads viewed) to 100 (all ads viewed). DomainViewed int `json:"domainViewed"` // DomainHidden represents the ratio of ads likely hidden grouped by // domain, ranging from 0 (no ads hidden) to 100 (all ads hidden). DomainHidden int `json:"domainHidden"` // SellerViewed represents the ratio of ads viewed grouped by seller, // ranging from 0 (no ads viewed) to 100 (all ads viewed). SellerViewed int `json:"sellerViewed"` // SellerHidden represents the ratio of ads likely hidden grouped by // seller, ranging from 0 (no ads hidden) to 100 (all ads hidden). SellerHidden int `json:"sellerHidden"` // IPReputation is true if Forensiq have flagged high-risk activity from // the IP in the past (e.g. User Agent spoofing, IP manipulation etc.). IPReputation bool `json:"ipr"` // Proxy is true if IP is a proxy. Proxy bool `json:"pxy"` // AutomatedTraffic is true if malicious botnet and other types of // automated activity identified through real-time traffic pattern // analysis. AutomatedTraffic bool `json:"atf"` // HostingProvider Use of an ISP, which Forensiq recognized as a // hosting provider. Servers in hosting providers are used to send spam, // host malware, botnet controllers, or engage in other suspect activities. HostingProvider bool `json:"hst"` // Spoofed is true if Forensiq see patterns of spoofing within the user’s // device. This characteristic is limited to analyzing the user agent of // the user within the pre-bid environment. Spoofed int // NonSuspect is true if the client is not suspected of being a bot NonSuspect bool `json:"nonSuspect"` // TimeMS represents the time it took for the request to complete in // Millisecond. TimeMS int `json:"timeMs"` }
CheckResponse is returned by Forensiq API.
type Forensiq ¶
type Forensiq struct { // ClientKey is an authentication key for each client’s account provided by // Forensiq. Required. ClientKey string // Host is the host where the Forensiq API is available at. Host string // contains filtered or unexported fields }
Forensiq represents a forensiq API client.
func New ¶
New returns a new Forensiq initialized with given host and clientKey and use http.DefaultClient as the HTTP client.
func (*Forensiq) Check ¶
func (f *Forensiq) Check(ctx context.Context, creq CheckRequest) (CheckResponse, error)
Check get the riskScore and aggregate characteristics.
func (*Forensiq) SetHTTPClient ¶
SetHTTPClient sets a custom HTTP Client to use when sending requests to forensiq. By default http.DefaultClient is used.
Click to show internal directories.
Click to hide internal directories.