Skip to content

Commit 003fa4e

Browse files
committed
docs: Add posthog usage analytics
1 parent 8414ef4 commit 003fa4e

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

docs/mkdocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ site_url: http://localhost:8080/docs/
33

44
theme:
55
name: material
6+
custom_dir: overrides
67
favicon: assets/cogstack-logo.png
78
logo: assets/cogstack-logo.png
89
icon:
@@ -93,6 +94,10 @@ plugins:
9394
- search
9495
- termynal
9596

97+
extra:
98+
analytics:
99+
provider: custom
100+
96101
markdown_extensions:
97102
- admonition
98103
- attr_list
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{#-
2+
PostHog analytics integration (custom provider).
3+
Loads on every page; works with instant navigation via location$.
4+
-#}
5+
<script>
6+
!function(t,e){var o,n,p,r;e.__SV||(window.posthog=e,e._i=[],e.init=function(i,s,a){function g(t,e){var 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);var u=e;for(void 0!==a?u=e[a]=[]:a="posthog",u.people=u.people||[],u.toString=function(t){var 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||[]);
7+
posthog.init('phc_kCks07Y0m56WvCKnS4RjZ4bp3HePHkma8MvNmBFfPvL', {
8+
api_host: 'https://b.cogstack.org',
9+
ui_host: 'https://eu.posthog.com',
10+
defaults: '2026-01-30'
11+
});
12+
document.addEventListener("DOMContentLoaded", function() {
13+
if (typeof location$ !== "undefined") {
14+
location$.subscribe(function(url) {
15+
if (window.posthog) posthog.capture("$pageview", { $current_url: url.href });
16+
});
17+
}
18+
});
19+
</script>

0 commit comments

Comments
 (0)