Skip to content

Commit

Permalink
fix(core): move analytics id to app config
Browse files Browse the repository at this point in the history
  • Loading branch information
musicEnfanthen committed Oct 9, 2020
1 parent 59479a7 commit 57020b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/app/app.config.ts
Expand Up @@ -26,6 +26,16 @@ export class AppConfig {
return 'https://www.google-analytics.com/';
}

/**
* Getter for the Analytics id
* ({@link 'UA-XXXXXXX-Y'}).
*
* @returns {string}
*/
public static get ANALYTICS_ID(): string {
return 'UA-64657372-2';
}

/**
* Getter for the URL of the Inseri Test Instance
* ({@link http://test-nieos.nie-ine.ch}).
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/services/analytics-sercvice/analytics.service.ts
Expand Up @@ -41,7 +41,7 @@ export class AnalyticsService {
*
* It stores the analytics object.
*/
private analyticsConfig: AnalyticsConfig = { trackingId: 'UA-64657372-2' };
private analyticsConfig: AnalyticsConfig = { trackingId: AppConfig.ANALYTICS_ID };

/**
* Private variable: isInitialized.
Expand Down Expand Up @@ -163,7 +163,7 @@ export class AnalyticsService {
// cf. https://developers.google.com/analytics/devguides/collection/analyticsjs/debugging#testing_your_implementation_without_sending_hits
/* istanbul ignore else */
if (!(document.location.hostname === 'edition.anton-webern.ch')) {
console.log('Running non-production google analytics replacement now');
console.log('Running non-production analytics replacement now');
(window as any).ga('set', 'sendHitTask', null);
}

Expand Down

0 comments on commit 57020b8

Please sign in to comment.