Skip to content

Commit

Permalink
Merge pull request #190 from odracirdev/posthog
Browse files Browse the repository at this point in the history
feat: 🚀 Add PostHog
  • Loading branch information
AnaRangel authored Aug 12, 2024
2 parents 9ec64e3 + 1263c9f commit 24ae6e2
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 4 deletions.
51 changes: 51 additions & 0 deletions src/components/PostHog.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
---

<script is:inline>
!(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 + '/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 =
'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 getNextSurveyStep onSessionId setPersonProperties'.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_cxvse3z6xsYpEYDgoQRn8Xc9e0UUBCQCOJvy0IalWxg', {
api_host: 'https://us.i.posthog.com',
person_profiles: 'identified_only',
});
</script>
7 changes: 4 additions & 3 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export { default as Aurora } from './Aurora.astro';
export { default as Avatar } from './Avatar.astro';
export { default as Button } from './Button/Button.astro';
export { default as ButtonDownloadCv } from './ButtonDownloadCv/ButtonDownloadCv.astro';
export * from './Cards';
Expand All @@ -6,7 +8,6 @@ export * from './GradientBackground';
export * from './Icon';
export { default as LanguageToggle } from './LanguageToggle/LanguageToggle.astro';
export { default as Navbar } from './Navbar.astro';
export { default as Tooltip } from './Tooltip/Tooltip.astro';
export { default as Avatar } from './Avatar.astro';
export { default as PostHog } from './PostHog.astro';
export { default as ScrollBack } from './ScrollBack.astro';
export { default as Aurora } from './Aurora.astro';
export { default as Tooltip } from './Tooltip/Tooltip.astro';
4 changes: 3 additions & 1 deletion src/layouts/Base.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
import '@styles/main.scss';
import { Avatar } from '@components';
import { Avatar, PostHog } from '@components';
interface Props {
title: string;
Expand Down Expand Up @@ -36,6 +36,8 @@ const ogImage = new URL('/img/og.jpg', baseUrl);
<meta property="og:locale" content="es_ES" />

<meta name="robots" content="index, follow" />

<PostHog />
</head>
<body>
<slot />
Expand Down

0 comments on commit 24ae6e2

Please sign in to comment.