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

Implement PostHog Analytics for API Request Insights #2230

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

linhexu
Copy link

@linhexu linhexu commented Nov 14, 2024

Description

This pull request integrates PostHog analytics into the Stirling-PDF application to track file upload sizes, PDF page counts, and processing times for API requests. The goal of this enhancement is to gain valuable insights into how users interact with our application, specifically the types and sizes of files they are working with, and the efficiency of our processing times.

By capturing this data, we can better understand user behavior, identify potential performance bottlenecks, and tailor our services to meet the needs of our user base more effectively. This feature is particularly valuable as it will help us optimize the application for the most common use cases and improve the overall user experience.

Why is this feature valuable?

User Behavior Analysis: Tracking file upload sizes and PDF page counts will provide us with insights into the types of documents our users are handling. This information can guide future feature development and resource allocation.

Performance Monitoring: Capturing processing times will allow us to monitor the performance of our API requests and identify areas for improvement, ensuring that our application remains fast and responsive.

Product Improvement: Understanding how users engage with Stirling-PDF will help us uncover opportunities for product enhancement, allowing us to continuously improve and adapt to user needs.

Resource Planning: Analyzing the data can aid in resource planning, such as server capacity and bandwidth requirements, to support user growth and business expansion.

Closes #2194

Checklist

  • [✓] I have read the Contribution Guidelines
  • [✓] I have performed a self-review of my own code
  • [✓] I have attached images of the change if it is UI based (Not applicable in this case as the change is not UI-based)
  • [✓] I have commented my code, particularly in hard-to-understand areas
  • [✓] My changes generate no new warnings
  • [✓] I have read the section Add New Translation Tags (Not applicable in this case as no new translation tags were added)

Implementation Details

PostHog Integration: The PostHog SDK has been integrated into the application to capture and send analytics data.
Data Capture: The application now captures file upload sizes, PDF page counts, and processing times for each API request.
Data Privacy: The analytics data captured does not include any personally identifiable information (PII), ensuring user privacy.

Additional Notes

The implementation has been tested to ensure accurate data capture and transmission to PostHog.
Documentation has been updated to include information on the analytics data being captured and how it can be accessed.

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Nov 14, 2024
@github-actions github-actions bot added the Front End Issues or pull requests related to front-end development label Nov 14, 2024
@dosubot dosubot bot added the enhancement New feature or request label Nov 14, 2024
@Frooodle
Copy link
Member

Love the code change
But seems to be few issues

Posthog is already initialized and has api key assigned from our common.html

So no need for that duplication

You also built this pr on top of your other PR changes which were not accepted meaning we can't accept this one

People remove all file changes not related to this PR so we can merge it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Front End Issues or pull requests related to front-end development size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: Multi-tool add blank page between pages as a option
2 participants