bs4TrapEvent = (event) => {
    const xhr = new XMLHttpRequest();

    xhr.open("POST", 'api/v1/networkevent', true);
    //xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
    xhr.setRequestHeader('X-CSRF-TOKEN', document.querySelector('meta[name="csrf-token"]').content);

    let data = new FormData();
    data.append('type', 'click_event');
    data.append('subtype', 'javascript');
    data.append('data', event);
    xhr.send(data);
}
document.addEventListener('click', bs4TrapEvent);