feat: Add sentry and smartlook tracking on 404 page (#23907)

## Description

To gather more information about chunk load errors (#22905) we are
adding some tracking info in the error page
This commit is contained in:
Hetu Nandu 2023-05-31 14:26:11 +05:30 committed by GitHub
parent ca580384d7
commit 693d04edb3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,47 @@
href="https://res.cloudinary.com/dwpfockn8/image/upload/v1597920848/favicons/favicon-orange_pxfmdc.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Appsmith</title>
<link rel="stylesheet" href="404.css">
<link rel="stylesheet" href="404.css">
<script>
// Function to ensure we parse the config correctly and handle any falsy values
// '' (empty strings), 'false' are falsy
// could return either boolean or string based on value
const parseConfig = (config) => {
if (config.indexOf("__") === 0 || config.indexOf("$") === 0 || config.indexOf("%") === 0)
return "";
const result = config.trim();
if (result.toLowerCase() === "false" || result === "") {
return false;
} else if (result.toLowerCase() === "true") {
return true;
}
return result;
}
const smartLookId = parseConfig("__APPSMITH_SMART_LOOK_ID__");
const sentryDSN = parseConfig("__APPSMITH_SENTRY_DSN__");
</script>
<script type='text/javascript'>
if(smartLookId) {
window.smartlook||(function(d) {
var o=smartlook=function(){ o.api.push(arguments)},h=d.getElementsByTagName('head')[0];
var c=d.createElement('script');o.api=new Array();c.async=true;c.type='text/javascript';
c.charset='utf-8';c.src='https://web-sdk.smartlook.com/recorder.js';h.appendChild(c);
})(document);
smartlook('init', smartLookId, { region: 'eu' });
smartlook("track", "UserReached404");
}
</script>
<script id="sentryScript"></script>
<script>
if(sentryDSN) {
const sentryURL = `https://js.sentry-cdn.com/${sentryDSN}.min.js`;
document.getElementById('sentryScript').src = sentryURL;
document.getElementById("sentryScript").crossorigin = "anonymous";
}
</script>
</head>
<body>
<div class="header-root">