Skip to content

Commit

Permalink
Add TelemetryDeck as the new website analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
edvinlinden committed Dec 4, 2024
1 parent 3b7b5d4 commit 93cee6c
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 148 deletions.
2 changes: 1 addition & 1 deletion .astro/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1721145354948
"lastUpdateCheck": 1733336855591
}
}
5 changes: 0 additions & 5 deletions src/components/YearNavigationBar/YearNavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ const YearNavigationBar: React.FC<YearNavigationBarInterface> = ({
let onYearChange = (event: any) => {
event.preventDefault();
const year = event.target.value;
const disableTracking = import.meta.env.DEV;

location.hash = "#" + year;

if (!disableTracking) {
window.fathom.trackEvent("Change year");
}
};

return (
Expand Down
77 changes: 3 additions & 74 deletions src/layouts/page.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import OverlayButtons from "@components/OverlayButtons/OverlayButtons";
import ShareCard from "@components/ShareCard/ShareCard";
const { title, description, url } = Astro.props;
const openGraphImage = "https://killedby.tech/images/og.png";
const disableTracking = import.meta.env.DEV;
---

<html lang="en">
Expand Down Expand Up @@ -35,78 +34,8 @@ const disableTracking = import.meta.env.DEV;
<Footer />
<OverlayButtons client:idle />
<ShareCard client:idle />
{
disableTracking ? null : (
<script
src="https://cdn.usefathom.com/script.js"
data-site="SNZPDDNM"
defer
/>
<script type="text/javascript" defer>
let scrollPercentagesReached = [0];
const updatePosition = () => {
const scrollPercentage = Math.floor(
(window.pageYOffset / (document.body.offsetHeight - window.innerHeight)) * 100
);

const firstScrollToFivePercent =
scrollPercentage > 5 &&
scrollPercentagesReached.indexOf(5) === -1;

const firstScrollToTenPercent =
scrollPercentage > 10 &&
scrollPercentagesReached.indexOf(10) === -1;

const firstScrollToTwentyFivePercent =
scrollPercentage > 25 &&
scrollPercentagesReached.indexOf(25) === -1;

const firstScrollToFiftyPercent =
scrollPercentage > 50 &&
scrollPercentagesReached.indexOf(50) === -1;

const firstScrollToSeventyFivePercent =
scrollPercentage > 75 &&
scrollPercentagesReached.indexOf(75) === -1;

const firstScrollToHundredPercent =
scrollPercentage > 100 &&
scrollPercentagesReached.indexOf(100) === -1;

if (firstScrollToFivePercent) {
scrollPercentagesReached = [...scrollPercentagesReached, 5];
window.fathom.trackGoal('2AATBZ6B', 0);
}

if (firstScrollToTenPercent) {
scrollPercentagesReached = [...scrollPercentagesReached, 10];
window.fathom.trackGoal('S98TZAOP', 0);
}

if (firstScrollToTwentyFivePercent) {
scrollPercentagesReached = [...scrollPercentagesReached, 25];
window.fathom.trackGoal('G6VVPETM', 0);
}

if (firstScrollToFiftyPercent) {
scrollPercentagesReached = [...scrollPercentagesReached, 50];
window.fathom.trackGoal('HLOUPRQG', 0);
}

if (firstScrollToSeventyFivePercent) {
scrollPercentagesReached = [...scrollPercentagesReached, 75];
window.fathom.trackGoal('UBP92KPZ', 0);
}

if (firstScrollToHundredPercent) {
scrollPercentagesReached = [...scrollPercentagesReached, 100];
window.fathom.trackGoal('QRRO06XP', 0);
}
};

window.addEventListener("scroll", updatePosition);
</script>
)
}
<script
src="https://cdn.telemetrydeck.com/websdk/telemetrydeck.min.js"
data-app-id="C6B4A345-3CE8-4715-B3A7-8F3C093BA4E3"></script>
</body>
</html>
120 changes: 65 additions & 55 deletions src/layouts/post.astro
Original file line number Diff line number Diff line change
@@ -1,60 +1,70 @@
---
import { format } from "date-fns";
import '@assets/styles/global.scss';
import Footer from '@components/Footer/Footer';
const { title, heading, description, date, url, image } = Astro.props;
const openGraphImage = image == "" ? "https://killedby.tech/images/og.png" : image;
const disableTracking = import.meta.env.DEV;
const published_time = date + "T00:00:00.000+01:00";
import { format } from "date-fns";
import "@assets/styles/global.scss";
import Footer from "@components/Footer/Footer";
const { title, heading, description, date, url, image } = Astro.props;
const openGraphImage =
image == "" ? "https://killedby.tech/images/og.png" : image;
const published_time = date + "T00:00:00.000+01:00";
---
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width">
<meta name="description" content={ description }>
<meta property="og:url" content={ url }>
<meta property="og:type" content="article">
<meta property="og:title" content={ title }>
<meta property="og:description" content={ description }>
<meta property="og:image" content={ openGraphImage }>
<meta name="twitter:card" content="summary_large_image">
<meta property="twitter:domain" content="killedby.tech">
<meta property="twitter:url" content={ url }>
<meta name="twitter:title" content={ title }>
<meta name="twitter:description" content={ description }>
<meta name="twitter:image" content={ openGraphImage }>
<meta property="article:published_time" content={published_time}>
<meta property="article:section" content="Technology">
<meta property="article:author" content="Edvin Lindén">
<link rel="icon" href="/images/favicon.svg" type="image/svg+xml">
<title>{ title }</title>
</head>
<body>
<div class="main">
<div style="display:flex; justify-content:space-between; align-items: center;">
<h1 style="margin-bottom:0px;">Killed by *</h1>
<a href="/">Back to the graveyard ↩</a>
</div>
<h2 class="ingress">A graveyard for discontinued products from Apple, Google and Microsoft</h2>

<ol class="breadcrumbs" style="margin-top:3rem; margin-bottom: 6rem;">
<li>
<a href="/articles/">Articles</a>
<div class="chevron" />
</li>
<li>
{title}
</li>
</ol>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<meta name="description" content={description} />
<meta property="og:url" content={url} />
<meta property="og:type" content="article" />
<meta property="og:title" content={title} />
<meta property="og:description" content={description} />
<meta property="og:image" content={openGraphImage} />
<meta name="twitter:card" content="summary_large_image" />
<meta property="twitter:domain" content="killedby.tech" />
<meta property="twitter:url" content={url} />
<meta name="twitter:title" content={title} />
<meta name="twitter:description" content={description} />
<meta name="twitter:image" content={openGraphImage} />
<meta property="article:published_time" content={published_time} />
<meta property="article:section" content="Technology" />
<meta property="article:author" content="Edvin Lindén" />
<link rel="icon" href="/images/favicon.svg" type="image/svg+xml" />
<title>{title}</title>
</head>
<body>
<div class="main">
<div
style="display:flex; justify-content:space-between; align-items: center;"
>
<h1 style="margin-bottom:0px;">Killed by *</h1>
<a href="/">Back to the graveyard ↩</a>
</div>
<h2 class="ingress">
A graveyard for discontinued products from Apple, Google and
Microsoft
</h2>

</div>
<article>
<h1>{heading}</h1>
<p class="metaText" title={date}>{format(new Date(date), "PPP")}</p>
<ol
class="breadcrumbs"
style="margin-top:3rem; margin-bottom: 6rem;"
>
<li>
<a href="/articles/">Articles</a>
<div class="chevron"></div>
</li>
<li>
{title}
</li>
</ol>
</div>
<article>
<h1>{heading}</h1>
<p class="metaText" title={date}>{format(new Date(date), "PPP")}</p>

<slot />
</article>
<Footer />
{disableTracking ? null : <script src="https://cdn.usefathom.com/script.js" data-site="SNZPDDNM" defer></script>}
</body>
</html>
<slot />
</article>
<Footer />
<script
src="https://cdn.telemetrydeck.com/websdk/telemetrydeck.min.js"
data-app-id="C6B4A345-3CE8-4715-B3A7-8F3C093BA4E3"></script>
</body>
</html>
45 changes: 32 additions & 13 deletions src/pages/privacy.astro
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
---
import Page from '@layouts/page.astro';
import Navigation from '@components/Navigation/Navigation';
import Page from "@layouts/page.astro";
import Navigation from "@components/Navigation/Navigation";
---

<Page
title="Privacy"
description="Privacy policy for Killed by, a free and open source list of discontinued products and services from companies like Google, Apple and Microsoft."
url="https://killedby.tech/privacy/"
title="Privacy"
description="Privacy policy for Killed by, a free and open source list of discontinued products and services from companies like Google, Apple and Microsoft."
url="https://killedby.tech/privacy/"
>
<h1>Killed by *</h1>
<Navigation />
<h2>Privacy</h2>
<p>I want to process as little personal information as possible when you use my website. That's why I've chosen Fathom Analytics for my website analytics, which doesn't use cookies and complies with the GDPR, ePrivacy (including PECR), COPPA and CCPA.</p>
<p>Using this privacy-friendly website analytics software, your IP address is only briefly processed, and I have no way of identifying you. As per the CCPA, your personal information is de-identified. You can read more about this on <a href="https://usefathom.com/compliance" target="_blank" rel="noopener noreferrer">Fathom Analytics' website</a>.</p>
<p>The purpose of me using this software is to understand my website traffic in the most privacy-friendly way possible so that I can continually improve my website. The lawful basis as per the GDPR is "f); where our legitimate interests are to improve our website and business continually." As per the explanation, no personal data is stored over time.</p>
<h1>Killed by *</h1>
<Navigation />
<h2>Privacy</h2>
<p>
I want to process as little personal information as possible when you
use my website. That's why I've chosen TelemetryDeck for my website
analytics.
</p>
<p>
The purpose of me using this software is to understand my website
traffic in the most privacy-friendly way possible so that I can
continually improve my website. The lawful basis as per the GDPR is "f);
where our legitimate interests are to improve our website and business
continually." As per the explanation, no personal data is stored over
time.
</p>
<p>
TelemetryDeck <mark
>does not collect any personally identifiable information</mark
> and <mark>does not use cookies</mark>. You can read more about
TelemetryDeck’s privacy policy at
<a
href="https://telemetrydeck.com/privacy"
title="TelemetryDeck - Privacy Policy"
target="_blank">https://telemetrydeck.com/privacy</a
>
</p>
</Page>


0 comments on commit 93cee6c

Please sign in to comment.