@aller/blink
Version:
A library for tracking user behaviour.
126 lines (122 loc) • 5.58 kB
text/typescript
export interface BlinkEvent {
id: string; // Unique ID, used internally in Blink
// Things that most events have
pageView: string; // Unique ID for each loaded page
referrer?: string; // URL of previous page
site?: string; // Domain of current site
type:
| 'pageLoad'
| 'videoLoad'
| 'impression'
| 'activeTime'
| 'ads'
| 'click'
| 'video'
| 'videoWatch'
| 'videoAd'
| 'custom'
| 'box'
| 'error';
userId?: string; // Unique ID for given user
version?: string; // Version number for Blink
// Specific to a few events
abCookie?: number; // A number representaing which AB-testing group the user is in
activeTime?: number; // Total active time spent on the page
adId?: string; // Unique ID for ad
article?: {
harvesterId?: string; // Unique ID calculated from article URL
url?: string; // Article URL
};
articleBodyHeight?: number; // Height in px for the article body
articleBodyTop?: number; // Position of article body, in pixels from top of the page
boxId?: string; // Unique ID for box elements
clickId?: string; // Unique ID for clicked elements
client?: string; // Video ad server client, e.g. 'googleima'
clientHeight?: number; // Height of the client viewport
clientWidth?: number; // Width of the client viewport
cmId?: string; // Unique ID across sites (cookie monster ID)
commercialSegments?: string; // A comma separated string of commercial segments
context?: string[]; // A list of strings describing the element clicked/inscreen and its parents in ascending order
creativeId?: string; // Unique ID for a given ad
customContent?: string; // A custom field for sending string data
customDomain?: string; // The custom "domain" the custom event relates to (e.g. "Ski Game")
customType?: string; // The custom type for this custom event
customValue?: number; // A custom field for sending numerical values
dfp?: {
adUnitPath?: string;
advertiserId?: number;
bidder?: string;
campaignId?: number;
creativeId?: number;
impressionViewableEventFired?: number;
inscreen?: 1 | 0; // Was the ad inscreen?
lineItemId?: number;
name?: string;
size?: number[]; // Ad size in px, [width, height]
loaded?: 1 | 0;
rendered?: 1 | 0; // Did the ad render? 1 | 0
sourceAgnosticCreativeId?: number;
sourceAgnosticLineItemId?: number;
};
duration?: number; // Time of a video ad in seconds
height?: number; // Height of the element
inscreenTime?: number; // Time in ms the element was inscreen
inscreenTime0?: number; // Time in ms the element was inscreen from pixel 0
isBumper?: boolean; // Whether the video ad is a "bumper" ad
maxScroll?: number; // The maximum percentage the user scrolled down the page
pageType?: string; // The type of page, e.g. "facebook instant article"
personalizationParametersRequested?: string;
personalizationSystemUsed?: string;
plussData?: {
hasAccess?: boolean; // If the user has access to DB Pluss or not
customerNumber?: string; // Db Pluss customer ID
};
position?: number; // Position of element on the page
previousArticlePreview?: {
title?: string;
inscreenTime?: number;
clicked?: boolean;
};
previousPageView?: string; // ID of previous page load
scroll?: {
offsetHeight?: number; // Height of the element
offsetTop?: number; // Pixels from top of the page for the elements
scrollHeight?: number; // Total height of the page
pos?: {
adLoad?: number; // Pixels from top of the page to the top of the viewport when ad loaded
inscreenDFP?: number; // Pixels from top of the page to the top of the viewport when ad went dfp was inscreen for ad
slotOnload?: number; // Pixels from top of the page to the top of the viewport when ad went dfp loaded for ad
slotRenderEnded?: number; // Pixels from top of the page to the top of the viewport when dfp rendered for ad
};
};
system?: string; // The system used for the video ads, e.g. 'adForm'
time?: Date;
timing?: {
firstByteToAdRequest?: number;
adRequestToDFPLoadEvent?: number;
adRequestToDFPRenderedEvent?: number;
};
title?: string; // Title of the element
trigger?: string;
videoEvent?: string; // Information related to controlling video players in articles
videoId?: string; // ID of the video the video event relates to
width?: number; // Width of the element
withAdBlock?: boolean; // represents if adBlock is turned on
// video specific
videoAdPosition?: string; // position of advertisement, could be 'pre', 'mid' or 'post'
videoDuration?: number; // duration of video
videoViewable?: boolean; // represents if video is in viewport
videoQuality?: string; // represents the quality label of the video
videoPlayVolume?: number; // volume of video (0-100) when played
videoStopVolume?: number; // volume of video (0-100) when stopped
videoPlayReason?: string; // start reason of playing, could be 'autoplay' or 'manual'
videoStopReason?: string; // stop reason, could be 'pause', 'complete' or 'exit'
videoPlayMuted?: boolean; // represents if video is muted when played
videoStopMuted?: boolean; // represents if video is muted when stopped
videoPlayPosition?: number; // seconds into the video when played
videoStopPosition?: number; // seconds into the video when stopped
viewable?: number; // Whether video ad was viewable (1) or not (0)
playerId?: string;
playerViewable?: boolean; // represents if player is in viewport
// end video specific
}