]> git.otsuka.systems Git - cotsuka.github.io/commitdiff
add posthog for my edification
authorCameron Otsuka <cameron@otsuka.haus>
Fri, 27 Feb 2026 05:09:24 +0000 (21:09 -0800)
committerCameron Otsuka <cameron@otsuka.haus>
Fri, 27 Feb 2026 05:09:24 +0000 (21:09 -0800)
src/components/head/posthog.astro [new file with mode: 0644]
src/layouts/base.astro

diff --git a/src/components/head/posthog.astro b/src/components/head/posthog.astro
new file mode 100644 (file)
index 0000000..bd0ea06
--- /dev/null
@@ -0,0 +1,57 @@
+<script is:inline>
+  /* eslint-disable @typescript-eslint/no-unused-expressions, prefer-rest-params */
+  !(function (t, e) {
+    let o, n, p, r;
+    e.__SV ||
+      ((window.posthog = e),
+      (e._i = []),
+      (e.init = function (i, s, a) {
+        function g(t, e) {
+          const o = e.split('.');
+          (2 == o.length && ((t = t[o[0]]), (e = o[1])),
+            (t[e] = function () {
+              t.push([e].concat(Array.prototype.slice.call(arguments, 0)));
+            }));
+        }
+        (((p = t.createElement('script')).type = 'text/javascript'),
+          (p.async = !0),
+          (p.src =
+            s.api_host.replace('.i.posthog.com', '-assets.i.posthog.com') +
+            '/static/array.js'),
+          (r = t.getElementsByTagName('script')[0]).parentNode.insertBefore(
+            p,
+            r,
+          ));
+        let u = e;
+        for (
+          void 0 !== a ? (u = e[a] = []) : (a = 'posthog'),
+            u.people = u.people || [],
+            u.toString = function (t) {
+              let e = 'posthog';
+              return (
+                'posthog' !== a && (e += '.' + a),
+                t || (e += ' (stub)'),
+                e
+              );
+            },
+            u.people.toString = function () {
+              return u.toString(1) + '.people (stub)';
+            },
+            o =
+              'init capture register register_once register_for_session unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group identify setPersonProperties setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags resetGroups onFeatureFlags addFeatureFlagsHandler onSessionId getSurveys getActiveMatchingSurveys renderSurvey canRenderSurvey getNextSurveyStep'.split(
+                ' ',
+              ),
+            n = 0;
+          n < o.length;
+          n++
+        )
+          g(u, o[n]);
+        e._i.push([i, s, a]);
+      }),
+      (e.__SV = 1));
+  })(document, window.posthog || []);
+  posthog.init('phc_JqRTVNfc9j8WH2eupbTg0rI1xG4YNXFZmbnujBaZIXU', {
+    api_host: 'https://us.i.posthog.com',
+    defaults: '2026-01-30',
+  });
+</script>
index 7ba611ac7dd383de326173374a9e732afecabbd4..2105735fd4700d8218dd438e50f95317e871838e 100644 (file)
@@ -5,6 +5,7 @@ import '@fontsource-variable/source-code-pro';
 import '@fontsource-variable/source-serif-4';
 import '@styles/style.css';
 import HeadBase from '@components/head/base.astro';
+import PostHog from '@components/head/posthog.astro';
 import HeadPage from '@components/head/page.astro';
 import Heading from '@components/heading.astro';
 import Footer from '@components/footer.astro';
@@ -21,6 +22,7 @@ const { title, description } = Astro.props;
 <html lang="en">
   <head>
     <HeadBase title={title} description={description} />
+    <PostHog />
     <slot name="post-head">
       <HeadPage />
     </slot>