@aller/blink
Advanced tools
Comparing version 8.24.8-alpha.0 to 8.24.9-alpha.0
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "8.24.8-alpha.0"; | ||
export declare const VERSION = "8.24.9-alpha.0"; | ||
/** | ||
@@ -3,0 +3,0 @@ * The minimum waiting time between each sending of active time events |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ACTIVE_TIME_INITIAL_MOBILE = exports.ACTIVE_TIME_WAIT = exports.VERSION = void 0; | ||
exports.VERSION = '8.24.8-alpha.0'; | ||
exports.VERSION = '8.24.9-alpha.0'; | ||
/** | ||
@@ -6,0 +6,0 @@ * The minimum waiting time between each sending of active time events |
@@ -21,2 +21,3 @@ "use strict"; | ||
var page = _a.page, webVitals = _a.webVitals; | ||
console.log('webVitals in prepace-cwv-event', webVitals); | ||
var _b = page.state.general, url = _b.url, site = _b.site; | ||
@@ -23,0 +24,0 @@ var id = get_id_from_url_1.default(url, site); |
@@ -74,2 +74,3 @@ "use strict"; | ||
webVitals: function (input) { | ||
console.log('input from createBlink', input); | ||
store.dispatch({ type: actions_1.WEB_VITALS, payload: { input: input } }); | ||
@@ -76,0 +77,0 @@ }, |
@@ -160,2 +160,4 @@ "use strict"; | ||
case actions_1.WEB_VITALS: | ||
console.log('action in sendermiddleware', action); | ||
console.log('payload in senderMiddleware', action.payload); | ||
send([ | ||
@@ -162,0 +164,0 @@ prepare_cwv_event_1.default({ |
{ | ||
"name": "@aller/blink", | ||
"version": "8.24.8-alpha.0", | ||
"version": "8.24.9-alpha.0", | ||
"description": "A library for tracking user behaviour.", | ||
@@ -69,3 +69,3 @@ "main": "lib/main.js", | ||
}, | ||
"gitHead": "9e01a8a650dc23a008a636b674f8698233545a8a" | ||
"gitHead": "b6b4bd036c924e6c05c60c4745b0e8eca23dc87a" | ||
} |
@@ -1,2 +0,2 @@ | ||
export const VERSION = '8.24.8-alpha.0'; | ||
export const VERSION = '8.24.9-alpha.0'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -17,2 +17,3 @@ import generalData from '../utils/general-data'; | ||
}: PrepareChromeWebVitalsInput): BlinkEvent { | ||
console.log('webVitals in prepace-cwv-event', webVitals); | ||
const { url, site } = page.state.general; | ||
@@ -19,0 +20,0 @@ const id = getIdFromUrl(url, site); |
@@ -370,2 +370,3 @@ import createStore from './store'; | ||
webVitals(input: ChromeWebVitalsInput): void { | ||
console.log('input from createBlink', input); | ||
store.dispatch({ type: WEB_VITALS, payload: { input } }); | ||
@@ -372,0 +373,0 @@ }, |
@@ -56,210 +56,212 @@ import prepareAdEvent, { | ||
(next: any) => | ||
(action: any) => { | ||
// Send all events if we get a pageInit event | ||
// Make sure we do it before the PAGE_INIT flushes the state | ||
if (action.type === PAGE_INIT) { | ||
const { payload } = action; | ||
const beforePage = getPageState(getState(), payload.pageId).state; | ||
const eventsToSend = [ | ||
...getAllAdEventsPrepared(beforePage, payload.time), | ||
...getAllActiveTimeEventsPrepared(beforePage, payload.time), | ||
]; | ||
if (eventsToSend.length > 0) { | ||
send(eventsToSend); | ||
(action: any) => { | ||
// Send all events if we get a pageInit event | ||
// Make sure we do it before the PAGE_INIT flushes the state | ||
if (action.type === PAGE_INIT) { | ||
const { payload } = action; | ||
const beforePage = getPageState(getState(), payload.pageId).state; | ||
const eventsToSend = [ | ||
...getAllAdEventsPrepared(beforePage, payload.time), | ||
...getAllActiveTimeEventsPrepared(beforePage, payload.time), | ||
]; | ||
if (eventsToSend.length > 0) { | ||
send(eventsToSend); | ||
} | ||
} | ||
} | ||
// Execute the action, which might mutate the state | ||
const returnValue = next(action); | ||
const state: any = getState(); | ||
const page = getPageState(state, action.payload.pageId); | ||
switch (action.type) { | ||
case DFP_IMPRESSION_VIEWABLE: | ||
case DFP_SLOT_RENDER_ENDED: | ||
case DFP_SLOT_ON_LOAD: | ||
send([ | ||
prepareAdEvent({ | ||
page, | ||
id: action.payload.id, | ||
}), | ||
]); | ||
break; | ||
case CLICK: | ||
sendDirect([ | ||
prepareClickEvent({ | ||
page, | ||
url: action.payload.url, | ||
abId: action.payload.abId, | ||
clickId: action.payload.clickId, | ||
externalId: action.payload.id, | ||
context: action.payload.context, | ||
}), | ||
]); | ||
break; | ||
case VIDEO_PLAY: | ||
send([ | ||
prepareVideoPlayForSending({ | ||
page, | ||
...action.payload, | ||
}), | ||
]); | ||
break; | ||
case VIDEO_LOAD: | ||
send([ | ||
prepareVideoLoadForSending({ | ||
page, | ||
...action.payload, | ||
}), | ||
]); | ||
break; | ||
case VIDEO_STOP: | ||
let _send = send; | ||
if (action && action.payload && action.payload.beforeunload) { | ||
_send = sendDirect; | ||
} | ||
// Execute the action, which might mutate the state | ||
const returnValue = next(action); | ||
const state: any = getState(); | ||
const page = getPageState(state, action.payload.pageId); | ||
switch (action.type) { | ||
case DFP_IMPRESSION_VIEWABLE: | ||
case DFP_SLOT_RENDER_ENDED: | ||
case DFP_SLOT_ON_LOAD: | ||
send([ | ||
prepareAdEvent({ | ||
page, | ||
id: action.payload.id, | ||
}), | ||
]); | ||
break; | ||
case CLICK: | ||
sendDirect([ | ||
prepareClickEvent({ | ||
page, | ||
url: action.payload.url, | ||
abId: action.payload.abId, | ||
clickId: action.payload.clickId, | ||
externalId: action.payload.id, | ||
context: action.payload.context, | ||
}), | ||
]); | ||
break; | ||
case VIDEO_PLAY: | ||
send([ | ||
prepareVideoPlayForSending({ | ||
page, | ||
...action.payload, | ||
}), | ||
]); | ||
break; | ||
case VIDEO_LOAD: | ||
send([ | ||
prepareVideoLoadForSending({ | ||
page, | ||
...action.payload, | ||
}), | ||
]); | ||
break; | ||
case VIDEO_STOP: | ||
let _send = send; | ||
if (action && action.payload && action.payload.beforeunload) { | ||
_send = sendDirect; | ||
} | ||
_send( | ||
prepareVideoWatchForSending({ | ||
page, | ||
...action.payload, | ||
}), | ||
); | ||
break; | ||
case PLAYER_HIDDEN: | ||
const videoIds = getUniqueVideoIdsForPlayer( | ||
page.state.video.events, | ||
action.payload.playerId, | ||
); | ||
// "Brodcast" player hidden event to all videos with the playerId | ||
videoIds.forEach(videoId => { | ||
send( | ||
_send( | ||
prepareVideoWatchForSending({ | ||
page: page, | ||
videoId, | ||
page, | ||
...action.payload, | ||
}), | ||
); | ||
}); | ||
break; | ||
case VIDEO_AD: | ||
send([ | ||
prepareVideoAdForSending({ | ||
page, | ||
...action.payload, | ||
}), | ||
]); | ||
break; | ||
case CUSTOM: | ||
send([ | ||
prepareCustomEvent({ | ||
page, | ||
customDomain: action.payload.customDomain, | ||
customType: action.payload.customType, | ||
customContent: action.payload.customContent, | ||
customValue: action.payload.customValue, | ||
time: action.payload.time, | ||
}), | ||
]); | ||
break; | ||
case PAGE_LOAD: | ||
send([ | ||
preparePageloadEvent({ | ||
page, | ||
url: action.payload.url, | ||
}), | ||
]); | ||
break; | ||
case PERFORMANCE: | ||
send([ | ||
preparePerformanceEvent({ | ||
page, | ||
performanceTimings: action.payload.performanceTimings, | ||
}), | ||
]); | ||
break; | ||
case WEB_VITALS: | ||
send([ | ||
prepareCwvEvent({ | ||
page, | ||
webVitals: action.payload.webVitals, | ||
}), | ||
]); | ||
break; | ||
case ARTICLE_PREVIEW_SCREEN_ENTER: | ||
send([ | ||
prepareImpressionEvent({ | ||
page, | ||
id: action.payload.id, | ||
abId: action.payload.abId, | ||
context: action.payload.context, | ||
url: action.payload.url, | ||
title: action.payload.title, | ||
personalizationSystemUsed: | ||
action.payload.personalizationSystemUsed, | ||
personalizationParametersRequested: | ||
action.payload.personalizationParametersRequested, | ||
height: action.payload.height, | ||
width: action.payload.width, | ||
}), | ||
]); | ||
break; | ||
case BOX_SCREEN_ENTER: | ||
send([ | ||
prepareBoxEvent({ | ||
page, | ||
id: action.payload.id, | ||
title: action.payload.title, | ||
height: action.payload.height, | ||
width: action.payload.width, | ||
}), | ||
]); | ||
break; | ||
case AD_SCREEN_EXIT: | ||
case AD_SCREEN_EXIT_0: | ||
send([ | ||
prepareAdEvent({ | ||
page, | ||
id: action.payload.id, | ||
}), | ||
]); | ||
break; | ||
case ARTICLE_ACTIVITY_STOP: | ||
send([ | ||
prepareActiveTimeEvent({ | ||
page, | ||
id: action.payload.id, | ||
}), | ||
]); | ||
break; | ||
case SEND_ALL_EVENTS: | ||
{ | ||
const { payload } = action; | ||
const eventsToSend = [ | ||
...getAllAdEventsPrepared(page, payload.time), | ||
...getAllActiveTimeEventsPrepared(page, payload.time), | ||
...getAllVideoWatchEventsPrepared(page, payload.time), | ||
]; | ||
if (eventsToSend.length > 0) { | ||
sendDirect(eventsToSend); | ||
break; | ||
case PLAYER_HIDDEN: | ||
const videoIds = getUniqueVideoIdsForPlayer( | ||
page.state.video.events, | ||
action.payload.playerId, | ||
); | ||
// "Brodcast" player hidden event to all videos with the playerId | ||
videoIds.forEach(videoId => { | ||
send( | ||
prepareVideoWatchForSending({ | ||
page: page, | ||
videoId, | ||
...action.payload, | ||
}), | ||
); | ||
}); | ||
break; | ||
case VIDEO_AD: | ||
send([ | ||
prepareVideoAdForSending({ | ||
page, | ||
...action.payload, | ||
}), | ||
]); | ||
break; | ||
case CUSTOM: | ||
send([ | ||
prepareCustomEvent({ | ||
page, | ||
customDomain: action.payload.customDomain, | ||
customType: action.payload.customType, | ||
customContent: action.payload.customContent, | ||
customValue: action.payload.customValue, | ||
time: action.payload.time, | ||
}), | ||
]); | ||
break; | ||
case PAGE_LOAD: | ||
send([ | ||
preparePageloadEvent({ | ||
page, | ||
url: action.payload.url, | ||
}), | ||
]); | ||
break; | ||
case PERFORMANCE: | ||
send([ | ||
preparePerformanceEvent({ | ||
page, | ||
performanceTimings: action.payload.performanceTimings, | ||
}), | ||
]); | ||
break; | ||
case WEB_VITALS: | ||
console.log('action in sendermiddleware', action); | ||
console.log('payload in senderMiddleware', action.payload); | ||
send([ | ||
prepareCwvEvent({ | ||
page, | ||
webVitals: action.payload.webVitals, | ||
}), | ||
]); | ||
break; | ||
case ARTICLE_PREVIEW_SCREEN_ENTER: | ||
send([ | ||
prepareImpressionEvent({ | ||
page, | ||
id: action.payload.id, | ||
abId: action.payload.abId, | ||
context: action.payload.context, | ||
url: action.payload.url, | ||
title: action.payload.title, | ||
personalizationSystemUsed: | ||
action.payload.personalizationSystemUsed, | ||
personalizationParametersRequested: | ||
action.payload.personalizationParametersRequested, | ||
height: action.payload.height, | ||
width: action.payload.width, | ||
}), | ||
]); | ||
break; | ||
case BOX_SCREEN_ENTER: | ||
send([ | ||
prepareBoxEvent({ | ||
page, | ||
id: action.payload.id, | ||
title: action.payload.title, | ||
height: action.payload.height, | ||
width: action.payload.width, | ||
}), | ||
]); | ||
break; | ||
case AD_SCREEN_EXIT: | ||
case AD_SCREEN_EXIT_0: | ||
send([ | ||
prepareAdEvent({ | ||
page, | ||
id: action.payload.id, | ||
}), | ||
]); | ||
break; | ||
case ARTICLE_ACTIVITY_STOP: | ||
send([ | ||
prepareActiveTimeEvent({ | ||
page, | ||
id: action.payload.id, | ||
}), | ||
]); | ||
break; | ||
case SEND_ALL_EVENTS: | ||
{ | ||
const { payload } = action; | ||
const eventsToSend = [ | ||
...getAllAdEventsPrepared(page, payload.time), | ||
...getAllActiveTimeEventsPrepared(page, payload.time), | ||
...getAllVideoWatchEventsPrepared(page, payload.time), | ||
]; | ||
if (eventsToSend.length > 0) { | ||
sendDirect(eventsToSend); | ||
} | ||
} | ||
} | ||
break; | ||
case CONSENT_V2: | ||
send([ | ||
prepareConsentEvent({ | ||
page, | ||
uuid: action.payload.uuid, | ||
tcfV2: action.payload.tcfV2, | ||
kind: action.payload.kind, | ||
consentGranted: action.payload.consentGranted, | ||
consentedToAll: action.payload.consentedToAll, | ||
applies: action.payload.applies, | ||
}), | ||
]); | ||
break; | ||
default: | ||
break; | ||
} | ||
return returnValue; | ||
}; | ||
break; | ||
case CONSENT_V2: | ||
send([ | ||
prepareConsentEvent({ | ||
page, | ||
uuid: action.payload.uuid, | ||
tcfV2: action.payload.tcfV2, | ||
kind: action.payload.kind, | ||
consentGranted: action.payload.consentGranted, | ||
consentedToAll: action.payload.consentedToAll, | ||
applies: action.payload.applies, | ||
}), | ||
]); | ||
break; | ||
default: | ||
break; | ||
} | ||
return returnValue; | ||
}; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
812865
17714