8000 fix(analytics): streamline posthog script loading and event capturing by aswwwanth · Pull Request #1974 · jackyzha0/quartz · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(analytics): streamline posthog script loading and event capturing #1974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: v4
Choose a base branch
from

Conversation

aswwwanth
Copy link

Fixes #1962

The posthogScript.onload() event isn't fired because we're not loading an external script (unlike other analytics providers). As a result, the pageview event wasn't being captured correctly.

This PR moves the pageview event-capturing logic inside the posthogScript itself, ensuring it registers properly when the script is loaded.

I've tested the changes locally and confirmed that events are now being sent correctly to PostHog.

Changes made:

  1. Moved pageview event capture into the inline posthogScript
  2. Removed a redudant pageview capture

Copy link
github-actions bot commented May 11, 2025
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
quartz ✅ Ready (View Log) Visit Preview b0c8829

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PostHog pageview events are not being sent
1 participant
0