Skip to content

Commit e259a0b

Browse files
committed
un-supress CORS errors
1 parent e7420a9 commit e259a0b

1 file changed

Lines changed: 1 addition & 14 deletions

File tree

analytics.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,7 @@ class AnalyticsTracker {
152152
// console.log('Fetched data: ', data);
153153
return data;
154154
} catch (error) {
155-
// Suppress CORS errors in local development
156-
const isLocalhost = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
157-
if (isLocalhost) {
158-
console.log('[Analytics] Skipping analytics in local development (CORS restriction)');
159-
} else {
160-
console.error('[Analytics] Fetch error: ', error);
161-
}
155+
console.error('[Analytics] Fetch error: ', error);
162156
}
163157
}
164158

@@ -398,13 +392,6 @@ class AnalyticsTracker {
398392
// Initialization
399393
// ========================
400394
static init() {
401-
// Skip analytics in local development to avoid CORS errors
402-
const isLocalhost = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1';
403-
if (isLocalhost) {
404-
console.log('[Analytics] Skipping analytics in local development environment.');
405-
return;
406-
}
407-
408395
// Only initialize analytics if user has consented
409396
if (!this.hasConsent()) {
410397
console.log('[Analytics] User has not consented to tracking. Analytics disabled.');

0 commit comments

Comments
 (0)