Guide3DLogService_V0.2.0.min.js and above requires
window.fetch()
and Promise()
support.
Download the declaration file Guide3DLogService_V0.2.0.d.ts if you develop in Typescript to add auto-completion / IntelliSense to your IDE as follows:
/// <reference path="./yourpath/Guide3DLogService_V0.2.0.d.ts"/>
<script src="https://services.guide3d.com/log/js/Guide3DLogService_V0.2.0.min.js"></script>
var oGuide3DLogServiceOptions = {
"debug": false,
"project": 100013,
"dryrun": true,
// "serviceUrl": "./res/php/services.guide3d.com/log/index.php" // cors support
// "targetOrigin": "*"
};
var oGuide3DLogService = new Guide3DLogService(oGuide3DLogServiceOptions);
console.log(oGuide3DLogService.toString());
oGuide3DLogService.logHeartbeat("GUIDE3D-KIOSK-L03P1000").then((oData) => {
console.log("A heartbeat for source \"" + oData.source + "\" was " + (oData.logged ? "successfully " : "NOT ") + "logged");
}).catch(function (oError) {
console.log("Error @ Guide3DLogService.logHeartbeat(): " + oError);
});
oGuide3DLogService.logEvent("GUIDE3D-KIOSK-L03P1000", Guide3DLogService.EVENT_TYPE_INFORMATION, "screensaver", "true", "timeout:30s").then((oData) => {
console.log("An event for source \"" + oData.source + "\" was " + (oData.logged ? "successfully " : "NOT ") + "logged");
}).catch(function (oError) {
console.log("Error @ Guide3DLogService.logEvent(): " + oError);
});