-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Load the toolbar without loading posthog-js #9100
Comments
You can still use posthog-js for the toolbar, just turn off all data capturing. It'll load more bytes of javascript than you might want, but it should work. |
Harder to explain to users to get library B you add library A with particular config over to get library B you add library B |
I tested this and for the workaround of including posthog-js but disabling all capture you set config
|
The usual scope creep alert, but... damn that's 3 different styles of writing "foo is enabled" 🤣 "One day" we would benefit from an unified approach like: { apiHost: 'https://foobar.com/', captureClicks: true, capturePageviews: true, captureRecording: false ) ... but don't get me started about what other things should be refactored in that library... :D |
Shopify redirects the hash param url back to homepage, so the toolbar doesn't load in Shopify. |
Hey team, I just noticed this issue.
This can be fixed using Window PostMessage API. Possible solution:
So using postMessage API you should be able to enable cross-window communication without worrying about query params being overridden by the frontend. |
Hello! I'm trying to install the toolbar on my shopify website with no success. I noticed that the hash is updated so i tried saving it into a variable and then loading it (see below). I'm able to do that but nothing seems to happen regardless. Please help. I'm so close to switching over to posthog for my analytics for shopify. I just need the toolbar and it'll be perfect. 🙏
|
Just to update anyone reading this in the future. I figured out the problem. It was because my shopify store had global css that set the display to none for empty divs. This effectively hid the toolbar. The workaround was to add a timeout (to wait for the toolbar to load) and set the display to block. Here's the code i used to do that:
|
Is your feature request related to a problem?
maybe associated with PostHog/posthog-js#65
Currently posthog-js controls toolbar initialisation. In toolbar.js/maybeLoadEditor
If you want to use, for example, only Segment on your site. You can use app.posthog.com to analyse your data. But can't use the toolbar on your site.
Describe the solution you'd like
If posthog-js only used the decide call to choose whether to add toolbar.js into the page and toolbar was responsible for its own initialisation then you could use toolbar without using posthog-js
The code could still live in the PostHog-js library and continue to be bundled separately
Describe alternatives you've considered
Not fixing this
Additional context
Thank you for your feature request – we love each and every one!
The text was updated successfully, but these errors were encountered: