Skip to content

Commit

Permalink
Update packages/frontend/src/scripts/usage-report.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
u1-liquid authored Nov 5, 2024
1 parent 995ac1a commit 54f49b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/frontend/src/scripts/usage-report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface UsageReport {
a: string;
}

let disableUsageReport = false;
let disableUsageReport = !instance.googleAnalyticsId;
const usageReportBuffer: UsageReport[] = [];
let usageReportBufferTimer: number | null = null;

Expand All @@ -43,7 +43,7 @@ export function sendUsageReport() {
const data = usageReportBuffer.splice(0, usageReportBuffer.length);
usageReportBufferTimer = null;

if (instance.googleAnalyticsId && (miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams)?.ad_user_data !== 'granted') {
if ((miLocalStorage.getItemAsJson('gtagConsent') as GtagConsentParams)?.ad_user_data !== 'granted') {
console.log('Usage report is not sent because the user has not consented to sharing data about ad interactions.');
disableUsageReport = true;
return;
Expand Down

0 comments on commit 54f49b2

Please sign in to comment.