-
Notifications
You must be signed in to change notification settings - Fork 4
feat: generate plausible events when a user is using the app #141
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
Conversation
5f42d7f to
26de0db
Compare
joanise
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's what we need, except I don't understand how it works. Are you willing to walk me through it a bit?
| console.log("[DEBUG] Audio is playing"); | ||
| this.status$.next({ id: audioId, status: "PLAYING" }); | ||
| //opted into plausible | ||
| if ((window as any).plausible) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find where this .plausible variable gets initialized. How does this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the plausible script is added to the index page it initialize itself into the global window namespace. The code is checking for that before attempting to generate the event.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if plausible is not defined at all, the fact that window has no plausible attribute just yields something undefined, which is falsish, unlike Python where that would raise an exception, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it would yield undefined and so the code block would not execute since undefined is not 'truthy'
joanise
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get it now, thanks for the clarifications in person and the comment here.
Looks good then.
When Plausible is enable the app will generate events for making a conjugation and using the TTS