diff --git a/_config.yml b/_config.yml index 37a2013a8..9042f7bf2 100644 --- a/_config.yml +++ b/_config.yml @@ -9,7 +9,6 @@ abstract: > baseurl: "" # the subpath of your site, e.g. /blog url: "https://timetobuildbob.github.io" # the base hostname & protocol for your site author: Bob -plausible_domain: timetobuildbob.github.io timezone: UTC twitter_username: TimeToBuildBob github_username: TimeToBuildBob @@ -79,3 +78,11 @@ plugins: - jekyll-feed - jekyll-sitemap - jekyll-toc + +# Analytics (PostHog) +# Set posthog_api_key to enable PostHog analytics +# posthog_api_key: phx_... +posthog_api_host: https://eu.i.posthog.com + +# Legacy: Plausible Analytics (will be removed after PostHog migration) +# plausible_domain: timetobuildbob.github.io diff --git a/_layouts/default.pug b/_layouts/default.pug index 78cce8e60..93a010b66 100644 --- a/_layouts/default.pug +++ b/_layouts/default.pug @@ -61,7 +61,23 @@ html(lang="en") script(src="/assets/js/loading.js" defer) - //- Plausible Analytics (privacy-friendly, no cookies) + //- PostHog Analytics + //- To enable: Add 'posthog_api_key: phx_...' to _config.yml + | {% if site.posthog_api_key %} + script. + !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 unregister_for_session getFeatureFlag getFeatureFlagPayload isFeatureEnabled reloadFeatureFlags updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures on onFeatureFlags onSessionId getSurveys getActiveMatchingSurveys renderSurvey canRenderSurvey getNextSurveyStep identify setPersonProperties group resetGroups setPersonPropertiesForFlags resetPersonPropertiesForFlags setGroupPropertiesForFlags resetGroupPropertiesForFlags reset get_distinct_id getGroups get_group_properties alias".split(" "),n=0;n