Skip to content

Commit

Permalink
devop: add redirect analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Mar 27, 2024
1 parent fbd2b0b commit a36d788
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions download.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<html>
<head>
<script type="text/javascript">
const activityUrl = "https://download.mewwallet.dev/record";
const EXTENSION_LINKS = {
chrome:
"https://chrome.google.com/webstore/detail/enkrypt/kkpllkodjeloidieedojogacfhpaihoh",
Expand Down Expand Up @@ -35,11 +36,20 @@
return "";
}
};
const doTheRedirect = (url, platform) => {
if (!fetch) document.location.href = url;
else
fetch(
`${activityUrl}?platform=enkrypt-${platform}&utm=generic`
).finally(() => {
document.location.href = url;
});
};
const browser = detect();
if (browser !== "") {
document.location.href = EXTENSION_LINKS[browser];
doTheRedirect(EXTENSION_LINKS[browser], browser);
} else {
document.location.href = EXTENSION_LINKS.chrome;
doTheRedirect(EXTENSION_LINKS[browser], BROWSER_NAMES.chrome);
}
</script>
</head>
Expand Down

0 comments on commit a36d788

Please sign in to comment.