Skip to content

Commit

Permalink
Add posthog
Browse files Browse the repository at this point in the history
  • Loading branch information
bhekaniatdba committed Dec 17, 2024
1 parent 42d78ed commit fc61fd9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
1 change: 0 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 13 additions & 8 deletions src/components/PostHog.astro
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script async is:inline>
---
---

<script>
!(function (t, e) {
var o, n, p, r
e.__SV ||
Expand All @@ -13,8 +17,11 @@
})
}
;((p = t.createElement("script")).type = "text/javascript"),
(p.crossOrigin = "anonymous"),
(p.async = !0),
(p.src = s.api_host + "/static/array.js"),
(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,
Expand All @@ -31,7 +38,7 @@
return u.toString(1) + ".people (stub)"
},
o =
"capture identify alias people.set people.set_once set_config register register_once unregister opt_out_capturing has_opted_out_capturing opt_in_capturing reset isFeatureEnabled onFeatureFlags getFeatureFlag getFeatureFlagPayload reloadFeatureFlags group updateEarlyAccessFeatureEnrollment getEarlyAccessFeatures getActiveMatchingSurveys getSurveys onSessionId".split(
"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_session_id get_session_replay_url alias set_config startSessionRecording stopSessionRecording sessionRecordingStarted captureException loadToolbar get_property getSessionProperty createPersonProfile opt_in_capturing opt_out_capturing has_opted_in_capturing has_opted_out_capturing clear_opt_in_out_capturing debug".split(
" ",
),
n = 0;
Expand All @@ -43,10 +50,8 @@
}),
(e.__SV = 1))
})(document, window.posthog || [])
posthog.init("phc_d7oRaSuwk3z7T1lItVIfITPoshbmNsf2z2oyE51XOmM", {
api_host: "https://app.posthog.com",
posthog.init("phc_nTzkYYISn6Nh0laiaVGKxa269g9uF6k1fOA4nri746S", {
api_host: "https://eu.i.posthog.com",
person_profiles: "identified_only", // or 'always' to create profiles for anonymous users as well
})
if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
posthog.opt_out_capturing()
}
</script>
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
// make indexing stricter
"noUncheckedIndexedAccess": true,
"allowJs": true
}
},
"exclude": ["src/components/PostHog.astro"]
}

0 comments on commit fc61fd9

Please sign in to comment.