Skip to content

Conversation

@deltork
Copy link
Collaborator

@deltork deltork commented Jan 27, 2026

When Plausible is enable the app will generate events for making a conjugation and using the TTS

@deltork deltork requested review from dlothian and joanise January 27, 2026 15:09
@deltork deltork force-pushed the delT/plausible-for-ev-plugin branch from 5f42d7f to 26de0db Compare January 27, 2026 15:15
Copy link
Member

@joanise joanise left a 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) {
Copy link
Member

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?

Copy link
Collaborator Author

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.

Copy link
Member

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?

Copy link
Collaborator Author

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'

@deltork deltork changed the title feat: generate plausible events when user is using the app feat: generate plausible events when a user is using the app Jan 27, 2026
Copy link
Member

@joanise joanise left a 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.

@deltork deltork merged commit 07321c4 into main Jan 30, 2026
1 check passed
@deltork deltork deleted the delT/plausible-for-ev-plugin branch January 30, 2026 13:21
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.

3 participants