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

[TAS-2787] 📈 Add logging for PDF download event #2007

Merged

Conversation

AuroraHuang22
Copy link
Contributor

@AuroraHuang22 AuroraHuang22 commented Dec 31, 2024

listen event from likecoin/pdf.js#10

@AuroraHuang22 AuroraHuang22 changed the title 📈 Add logging for PDF download event [TAS-2787] 📈 Add logging for PDF download event Dec 31, 2024
Copy link

log pdf download

},
1
);
console.log(`PDF downloaded: ${event.data.filename}`);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unneeded console.log

Comment on lines 87 to 96
logTrackerEvent(
this,
'ReaderPdf',
'PDFDownloaded',
{
classId: this.classId,
filename: event.data.filename,
},
1
);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4th param does not expect object
and maybe we should name it as present tense since download is not completed at this point

Suggested change
logTrackerEvent(
this,
'ReaderPdf',
'PDFDownloaded',
{
classId: this.classId,
filename: event.data.filename,
},
1
);
logTrackerEvent(
this,
'ReaderPdf',
'ReaderDownloadPdf',
classId: this.classId,
1
);

Comment on lines 85 to 86
}
if (event.data.event === 'pdfDownload') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
if (event.data.event === 'pdfDownload') {
} else if (event.data.event === 'pdfDownload') {

@williamchong williamchong merged commit 8f66340 into likecoin:develop Jan 2, 2025
1 check passed
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.

2 participants