TypeError: posthog.setPersonProperties is not a function with JS Snippet
Hello,
I'm setting up PostHog via GTM with the web snippet from https://eu.posthog.com/project/19615/settings/project#snippet but when I call posthog.setPersonProperties via GTM I got the Uncaught TypeError: posthog.setPersonProperties is not a function error 😢
What im doing / How to reproduce:
- Load web snippet (https://eu.posthog.com/project/19615/settings/project#snippet) via Google Tag Manager on "page initialization" (No issues here)
- Execute the
posthog.setPersonPropertiesfunction via Google Tag Manager on page initializacion with Tag Sequencing active to only execute AFTER posthog web snippet has ran (here is the issue) - Check DevTools and find "Uncaught TypeError: posthog.setPersonProperties is not a function" error
I'm using PostHog cloud with the free plan.
Anything I missed? Thanks!
PS: Might be related to https://github.com/PostHog/posthog-js/issues/702 where posthog.setPersonProperties is not being exposed by the web snippet?
Fixed - Following indications like #702 , i exposed the function on my own and its working now -->
resolved in https://github.com/PostHog/posthog/pull/23662