Open michalblaha opened 3 months ago
nové hledání u=1 (https://local.hlidacstatu.cz/hledat?q=osobaid%3Amarcel-hajek&qtl=20&u=1) staré hledání u=2 (https://local.hlidacstatu.cz/hledat?Q=osobaid%3Amarcel-hajek&u=2)
Z autocomplete se volá javascriptovým kódem API:
function sendTrackingDataToAPI(data) {
try {
const url = "https://api.hlidacstatu.cz/api/v2/tracking";
// Prepare the data as a Blob
const blobData = new Blob([JSON.stringify(data)], { type: 'application/json' });
// Send the data using the Beacon API
const success = navigator.sendBeacon(url, blobData);
if (!success) {
console.error("Data could not be sent with sendBeacon");
}
} catch (e) {
// If an exception occurs, do nothing (fire and forget)
}
}
plní se takhle:
let trackingData = {};
trackingData.selectedValue = value.split('÷')[0];
trackingData.lastQuery = autocompleteLastQuery;
trackingData.source = window.location.href;
trackingData.type = 'partialAutocomplete';
sendTrackingDataToAPI(trackingData);
a loguje se to jako information level log...
_fromwhisp=[query]