@aller/blink
Version:
A library for tracking user behaviour.
27 lines • 1.63 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var general_data_1 = __importDefault(require("../utils/general-data"));
/**
* Prepares a raw impression by aggregating its fields so that
* it can be sent to the server in the format aas expects.
*/
function prepareArticleImpressionEvent(_a) {
var page = _a.page, id = _a.id, context = _a.context, url = _a.url, title = _a.title, abId = _a.abId, personalizationSystemUsed = _a.personalizationSystemUsed, personalizationParametersRequested = _a.personalizationParametersRequested, height = _a.height, width = _a.width;
return __assign(__assign({}, general_data_1.default(page.state)), { id: id, context: context || undefined, abId: abId, type: 'impression', article: { url: url, harvesterId: id }, title: title || undefined, height: height || 0, width: width || 0, personalizationParametersRequested: personalizationParametersRequested || undefined, personalizationSystemUsed: personalizationSystemUsed || undefined });
}
exports.default = prepareArticleImpressionEvent;
//# sourceMappingURL=prepare-impression-event.js.map