Skip to content
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

chore: extended plausible events to include editor #345

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/studio-web/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
Studio
</button>
<button
class="nav__button"
class="nav__button plausible-event-name=Editor"
mat-button
[color]="currentURL === '/editor' ? 'accent' : ''"
[routerLink]="'editor'"
Expand Down
2 changes: 1 addition & 1 deletion packages/studio-web/src/app/editor/editor.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h1 i18n="Welcome message for app editor" id="welcome-header">
<div class="row mt-0 justify-content-center">
<button
i18n="Take the tour"
class="mb-4 col-9 center text-center plausible-event-name=Tour"
class="mb-4 col-9 center text-center plausible-event-name=EditorTour"
mat-raised-button
color="primary"
(click)="startTour()"
Expand Down
1 change: 1 addition & 0 deletions packages/studio-web/src/app/editor/editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export class EditorComponent implements OnDestroy, OnInit, AfterViewInit {
this.editorService.rasControl$.value,
this.editorService.slots,
this.readalong,
"Editor", //from
);
} else {
this.toastr.error($localize`Download failed.`, $localize`Sorry!`, {
Expand Down
12 changes: 7 additions & 5 deletions packages/studio-web/src/app/shared/download/download.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ Please host all assets on your server, include the font and package imports defi
}
}

registerDownloadEvent(selectedOutputFormat: SupportedOutputs) {
registerDownloadEvent(selectedOutputFormat: SupportedOutputs, from: string) {
const win = window;
(win as any).plausible("Download", {
props: { fileType: selectedOutputFormat },
(win as any).plausible(`Download`, {
props: { fileType: selectedOutputFormat, downloadSource: from },
});
}

Expand Down Expand Up @@ -206,6 +206,7 @@ Please host all assets on your server, include the font and package imports defi
rasXML: Document,
slots: ReadAlongSlots,
readalong: Components.ReadAlong,
from = "Studio",
) {
if (selectedOutputFormat == SupportedOutputs.html) {
var element = document.createElement("a");
Expand All @@ -222,7 +223,7 @@ Please host all assets on your server, include the font and package imports defi
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
this.registerDownloadEvent(selectedOutputFormat);
this.registerDownloadEvent(selectedOutputFormat, from);
} else {
this.toastr.error(
"JS & Fonts Bundle did not get loaded",
Expand Down Expand Up @@ -366,6 +367,7 @@ Use the text editor to paste the snippet below in your WordPress page:
timeOut: 30000,
}),
);
this.registerDownloadEvent(selectedOutputFormat, from);
} else {
let audio: HTMLAudioElement = new Audio(b64Audio);
this.rasService
Expand All @@ -383,7 +385,7 @@ Use the text editor to paste the snippet below in your WordPress page:
});

audio.remove();
this.registerDownloadEvent(selectedOutputFormat);
this.registerDownloadEvent(selectedOutputFormat, from);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2618,7 +2618,7 @@ export class ReadAlongComponent {
this.theme +
" background--" +
this.theme +
" icon-only annotation__layer__button__save"
" icon-only annotation__layer__button__save plausible-event-name=Create-Annotation-Layer"
}
title={this.getI18nString("save-layer")}
onClick={(e) => {
Expand Down