Skip to content

Conversation

@Almoizs-1310
Copy link

This pull request introduces a new analytics tracking system for the Google Docs plugin, enabling event logging for key user actions. It adds a dedicated analytics module that sends events to a remote endpoint, integrates analytics calls throughout the client UI, and enhances OAuth flow tracking with additional parameters. The main changes are grouped below:

Analytics Tracking System Implementation:

  • Added a new Analytics class in src/analytics/analytics.ts to handle event tracking, including methods for login, logout, browsing, creating, editing, and updating diagrams. Events are sent to a backend endpoint with relevant metadata, and a persistent analytics ID is generated and stored in local storage.
  • Introduced httpClient.ts using Axios to handle HTTP requests for analytics, including error handling for network issues.

Client Integration of Analytics:

  • Imported and used the analytics module in the client code (Sidebar.tsx and useAuth.ts), ensuring that user actions like login, logout, browsing, creating, editing, and updating diagrams trigger the appropriate analytics events. [1] [2] [3] [4] [5] [6] [7] [8]

OAuth Flow and URL Enhancements:

  • Modified the OAuth service in src/server/ui.js to include UTM parameters (utm_source, utm_medium, utm_campaign) for better tracking of plugin usage in authentication flows.
  • Updated the diagram edit URL in edit-diagram-dialog.tsx to append the pluginSource=googledocs query parameter, allowing backend analytics to attribute actions to the correct source.

@vercel
Copy link

vercel bot commented Dec 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
google-plugin Error Error Dec 29, 2025 2:49pm

@Almoizs-1310 Almoizs-1310 changed the title Mc 4112 add utm source and utm medium for plugin and track users activity for mixpanel MC:4112 add utm source and utm medium for plugin and track users activity for mixpanel Dec 29, 2025
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