Open timgl opened 4 years ago
I think we should also add screen
to all the libraries. We'll never know for example if the Python app is used for a website... or a game... or in a mobile app using PyMob
... or whatever else someone comes up with one day.
I'd then also add page
to the iOS and Android libraries following the same logic... and just to keep things consistent.
Hey @timgl , this seems to be one line function in all libraries. Is this the brief description of it or is there some nuance involved?
Nope, this is it! It's fairly simple, just involves doing PRs in all the libraries :)
Could you assign me to this issue?
Done!
@yakkomajuri do we want to move forward with this?
hey is this available I want to work on this and also need some guide coz this is my first time ever contributing to Posthog
Hey @timgl can I take this one if it is still valid?
I see in the documentation that all it has to be done now is posthog.capture('$pageview')
as a shortcut and it will automatically send the current url. Is this good enough or do we want a more explicit method like page
?
Mobile has a screen
method with an event called $screen
and a property called $screen_name
, this is available on android, ios, flutter and RN.
@timgl I have raised a PR for the JS library along with tests. Will take it up with the maintainers of each library for the best practices in each of them.
Meanwhile, I want to confirm the following:
https://posthog.com/docs/libraries
I will be proceeding with the above assumptions. Please let me know if there is anything else to take care of.
Looks like this is already implemented in the Python library: https://github.com/PostHog/posthog-python/blob/master/posthog/client.py#L325
Looks like this is already implement in the Python library: PostHog/posthog-python@
master
/posthog/client.py#L325
Mobile SDKs don't need a page
method since they have the screen
method already
https://github.com/PostHog/posthog-java/pull/61#issuecomment-2328355673
As mentioned by @marandaneto :
I dont think this makes sense in backend SDKs including this one. This is only for UI/frontend SDKs.
This would mean the Next.js, JS Web and the React libraries. Is that correct?
This would mean the Next.js, JS Web and the React libraries. Is that correct?
It looks like the React library internally uses posthog-js as well.
Also, the Next.js integration documentation clearly talks about using the React and Node.js SDKs.
I would then assume that the original PR is the only required effort needed for this issue.
yes, and they are all under https://github.com/postHog/posthog-js since they are just frameworks supported by this SDK
Is your feature request related to a problem? Please describe. I want to easily be able to capture pageviews. At the moment, in all libraries I need to do
posthog.capture('$pageview', {'$current_url': 'https://...'})
.Describe the solution you'd like I want to be able to do
posthog.page('https://...')
Additional context
Thank you for your feature request - we love each and every one!