diff --git a/.changeset/empty-places-care.md b/.changeset/empty-places-care.md new file mode 100644 index 000000000..ca07bcad3 --- /dev/null +++ b/.changeset/empty-places-care.md @@ -0,0 +1,5 @@ +--- +'@gitbook/integration-posthog': patch +--- + +Move posthog init to main function call diff --git a/integrations/posthog/src/script.raw.js b/integrations/posthog/src/script.raw.js index 808f415e6..1c3fd8fd4 100644 --- a/integrations/posthog/src/script.raw.js +++ b/integrations/posthog/src/script.raw.js @@ -64,5 +64,5 @@ function getCookie(cname) { e._i.push([i, s, a]); }), (e.__SV = 1)); + posthog.init(projectApiKey, { api_host: instanceAddress }); })(document, window.posthog || []); -posthog.init(projectApiKey, { api_host: instanceAddress });