window.onload = (function () {
var domainUrl = window.location.host;
var currentUrl = window.location.href;

var widgetId =false;
var src = “”;
var iconUrl = “https://chat4site.ai/icons/botIcon.png”;
// Find the script element with the data-widgetId attribute
var scriptElements = document.querySelectorAll(‘script[widgetId]’);
var scriptElement = null;

for (var i = 0; i {
})
.catch(error => {
// Handle any errors that occurred during the request
console.error(‘Error sending event:’, error);
});
}

function sendIntegrationInfo(widgetId) {
const url = ‘https://appsgeyser.com/api/ai/integration/’;

// Create an object with the data to send
const data = {
widgetId: widgetId,
domain: domainUrl,
url: currentUrl
};

// Send the POST request
fetch(url, {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’
},
body: JSON.stringify(data)
})
.then(response => {
})
.catch(error => {
// Handle any errors that occurred during the request
console.error(‘Error sending event:’, error);
});
}
})

Leave a comment

Design a site like this with WordPress.com
Get started