Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
18 changes: 17 additions & 1 deletion _layouts/default.pug
Original file line number Diff line number Diff line change
Expand Up @@ -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<o.length;n++)g(u,o[n]);e._i.push([i,s,a])},e.__SV=1)}(document,window.posthog||[]);
posthog.init('{{ site.posthog_api_key }}', {
api_host: '{{ site.posthog_api_host | default: "https://eu.i.posthog.com" }}',
person_profiles: 'identified_only',
loaded: function(posthog) {
if (window.location.hostname === 'localhost') {
posthog.opt_out_capturing();
}
}
})
| {% endif %}

//- Plausible Analytics (privacy-friendly, no cookies) — legacy, will remove after PostHog migration
//- To enable: Add 'plausible_domain: timetobuildbob.github.io' to _config.yml
| {% if site.plausible_domain %}
script(defer data-domain="{{ site.plausible_domain }}" src="https://plausible.io/js/script.js")
Expand Down
Loading