From e9f01624393ace326ef3d798dc1b70f328c74990 Mon Sep 17 00:00:00 2001 From: chamiakJ Date: Thu, 12 Jun 2025 09:26:00 +0530 Subject: [PATCH 1/3] Enhance documentation and integrate Google Analytics - Added an Analytics section to the README.md, detailing what is tracked, privacy measures, and opt-out instructions. - Implemented Google Analytics in index.html, including a privacy notice for open source users and environment-specific tracking IDs. - Updated worklenz-frontend README.md to include a License section. --- README.md | 21 +++++++++++++ worklenz-frontend/README.md | 5 ++++ worklenz-frontend/index.html | 57 ++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) diff --git a/README.md b/README.md index e7d4f89b..2e0b1ae5 100644 --- a/README.md +++ b/README.md @@ -192,6 +192,27 @@ Email [info@worklenz.com](mailto:info@worklenz.com) to disclose any security vul This project is licensed under the [MIT License](LICENSE). +## Analytics + +Worklenz uses Google Analytics to understand how the application is being used. This helps us improve the application and make better decisions about future development. + +### What We Track +- Anonymous usage statistics +- Page views and navigation patterns +- Feature usage +- Browser and device information + +### Privacy +- Analytics is opt-in only +- No personal information is collected +- Users can opt-out at any time +- Data is stored according to Google's privacy policy + +### How to Opt-Out +If you've previously opted in and want to opt-out: +1. Clear your browser's local storage for the Worklenz domain +2. Or click the "Decline" button in the analytics notice if it appears + ## Screenshots

diff --git a/worklenz-frontend/README.md b/worklenz-frontend/README.md index 02c573fc..46c4a267 100644 --- a/worklenz-frontend/README.md +++ b/worklenz-frontend/README.md @@ -8,6 +8,7 @@ Worklenz is a project management application built with React, TypeScript, and A - [Project Structure](#project-structure) - [Contributing](#contributing) - [Learn More](#learn-more) +- [License](#license) ## Getting Started @@ -93,3 +94,7 @@ To learn more about the technologies used in this project: - [TypeScript Documentation](https://www.typescriptlang.org/docs/) - [Ant Design Documentation](https://ant.design/docs/react/introduce) - [Vite Documentation](https://vitejs.dev/guide/) + +## License + +Worklenz is open source and released under the [GNU Affero General Public License Version 3 (AGPLv3)](LICENSE). diff --git a/worklenz-frontend/index.html b/worklenz-frontend/index.html index 86abad6e..989d4aa0 100644 --- a/worklenz-frontend/index.html +++ b/worklenz-frontend/index.html @@ -14,6 +14,63 @@ Worklenz + + From 1889c58598cce34bfa8ac22e01d3a5605eca79c6 Mon Sep 17 00:00:00 2001 From: chamiakJ Date: Thu, 12 Jun 2025 09:34:53 +0530 Subject: [PATCH 2/3] Refactor privacy notice implementation in index.html - Introduced a dedicated function to display the privacy notice for users of the open source version. - Updated the styling and content of the privacy notice for improved visibility and clarity. - Added a DOMContentLoaded event listener to conditionally show the notice based on the environment and previous interactions. --- worklenz-frontend/index.html | 45 ++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/worklenz-frontend/index.html b/worklenz-frontend/index.html index 989d4aa0..6d44efb5 100644 --- a/worklenz-frontend/index.html +++ b/worklenz-frontend/index.html @@ -43,33 +43,44 @@ // Initialize analytics initGoogleAnalytics(); - // Show privacy notice only for open source version - if (window.location.hostname !== 'worklenz.com' && - window.location.hostname !== 'app.worklenz.com' && - !localStorage.getItem('privacyNoticeShown')) { + // Function to show privacy notice + function showPrivacyNotice() { const notice = document.createElement('div'); notice.style.cssText = ` position: fixed; - bottom: 20px; - right: 20px; - background: #fff; - padding: 20px; - border-radius: 8px; - box-shadow: 0 2px 10px rgba(0,0,0,0.1); + bottom: 16px; + right: 16px; + background: #222; + color: #f5f5f5; + padding: 12px 16px 10px 16px; + border-radius: 7px; + box-shadow: 0 2px 8px rgba(0,0,0,0.18); z-index: 1000; - max-width: 400px; + max-width: 320px; font-family: Inter, sans-serif; + border: 1px solid #333; + font-size: 0.95rem; `; notice.innerHTML = ` -

Analytics Notice

-

This open source project uses Google Analytics to understand usage patterns and improve the application.

-

We only collect anonymous usage data. No personal information is tracked.

-
- -
+
Analytics Notice
+
This app uses Google Analytics for anonymous usage stats. No personal data is tracked.
+ `; document.body.appendChild(notice); } + + // Wait for DOM to be ready + document.addEventListener('DOMContentLoaded', function() { + // Check if we should show the notice + const isProduction = window.location.hostname === 'worklenz.com' || + window.location.hostname === 'app.worklenz.com'; + const noticeShown = localStorage.getItem('privacyNoticeShown') === 'true'; + + // Show notice if not in production and not shown before + if (!isProduction && !noticeShown) { + showPrivacyNotice(); + } + }); From 69313fba348d2a3d2b25fcb62305310b26af25e2 Mon Sep 17 00:00:00 2001 From: chamiakJ Date: Thu, 12 Jun 2025 09:38:24 +0530 Subject: [PATCH 3/3] Enhance privacy notice functionality in index.html - Updated the privacy notice button to use an ID for easier event handling. - Added an event listener to the button to manage the display of the notice and store user consent in localStorage. --- worklenz-frontend/index.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/worklenz-frontend/index.html b/worklenz-frontend/index.html index 6d44efb5..b95b837b 100644 --- a/worklenz-frontend/index.html +++ b/worklenz-frontend/index.html @@ -64,9 +64,16 @@ notice.innerHTML = `
Analytics Notice
This app uses Google Analytics for anonymous usage stats. No personal data is tracked.
- + `; document.body.appendChild(notice); + // Add event listener to button + const btn = notice.querySelector('#analytics-notice-btn'); + btn.addEventListener('click', function(e) { + e.preventDefault(); + localStorage.setItem('privacyNoticeShown', 'true'); + notice.remove(); + }); } // Wait for DOM to be ready