diff --git a/.env.example b/.env.example index 0fde896bb5..55a5c880f2 100644 --- a/.env.example +++ b/.env.example @@ -30,6 +30,7 @@ FRESHDESK_API_URL= FRESHDESK_API_TOKEN= # [Optional] analytics.mudita.com +ANALYTICS_ENABLED= ANALYTICS_API_URL= ANALYTICS_API_SITE_ID= diff --git a/.github/workflows/nexus-development.yml b/.github/workflows/nexus-development.yml index 21fedf5589..5e48e734e2 100644 --- a/.github/workflows/nexus-development.yml +++ b/.github/workflows/nexus-development.yml @@ -32,6 +32,7 @@ jobs: FONTS_DIRECTORY_URL: ${{ secrets.FONTS_DIRECTORY_URL }} FRESHDESK_API_URL: ${{ secrets.FRESHDESK_API_URL }} FRESHDESK_API_TOKEN: ${{ secrets.FRESHDESK_API_TOKEN }} + ANALYTICS_ENABLED: ${{ secrets.ANALYTICS_ENABLED }} ANALYTICS_API_URL: ${{ secrets.ANALYTICS_API_URL }} ANALYTICS_API_SITE_ID: ${{ secrets.ANALYTICS_API_SITE_ID }} FEATURE_TOGGLE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_ENVIRONMENT }} diff --git a/.github/workflows/nexus-pre-production.yml b/.github/workflows/nexus-pre-production.yml index 34f27a833c..94553fec59 100644 --- a/.github/workflows/nexus-pre-production.yml +++ b/.github/workflows/nexus-pre-production.yml @@ -33,6 +33,7 @@ jobs: FONTS_DIRECTORY_URL: ${{ secrets.FONTS_DIRECTORY_URL }} FRESHDESK_API_URL: ${{ secrets.FRESHDESK_API_URL }} FRESHDESK_API_TOKEN: ${{ secrets.FRESHDESK_API_TOKEN }} + ANALYTICS_ENABLED: ${{ secrets.ANALYTICS_ENABLED }} ANALYTICS_API_URL: ${{ secrets.ANALYTICS_API_URL }} ANALYTICS_API_SITE_ID: ${{ secrets.ANALYTICS_API_SITE_ID }} FEATURE_TOGGLE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_ENVIRONMENT }} diff --git a/.github/workflows/nexus-production.yml b/.github/workflows/nexus-production.yml index efd6f2f994..0b740cafc7 100644 --- a/.github/workflows/nexus-production.yml +++ b/.github/workflows/nexus-production.yml @@ -33,6 +33,7 @@ jobs: FONTS_DIRECTORY_URL: ${{ secrets.FONTS_DIRECTORY_URL }} FRESHDESK_API_URL: ${{ secrets.FRESHDESK_API_URL }} FRESHDESK_API_TOKEN: ${{ secrets.FRESHDESK_API_TOKEN }} + ANALYTICS_ENABLED: ${{ secrets.ANALYTICS_ENABLED }} ANALYTICS_API_URL: ${{ secrets.ANALYTICS_API_URL }} ANALYTICS_API_SITE_ID: ${{ secrets.ANALYTICS_API_SITE_ID }} FEATURE_TOGGLE_ENVIRONMENT: ${{ secrets.FEATURE_TOGGLE_ENVIRONMENT }} diff --git a/packages/app/src/analytic-data-tracker/services/analytic-data-tracker.factory.ts b/packages/app/src/analytic-data-tracker/services/analytic-data-tracker.factory.ts index 713851cb8f..c9390bf77a 100644 --- a/packages/app/src/analytic-data-tracker/services/analytic-data-tracker.factory.ts +++ b/packages/app/src/analytic-data-tracker/services/analytic-data-tracker.factory.ts @@ -64,7 +64,8 @@ export class AnalyticDataTrackerFactory { const appSettings = settingsService.getSettings() const _id = appSettings.applicationId - const trackingEnabled = appSettings.privacyPolicyAccepted + const trackingEnabled = + appSettings.privacyPolicyAccepted && process.env.ANALYTICS_ENABLED === "1" const axiosInstance: AxiosInstance = axios.create({ httpsAgent: new https.Agent({