Closed venkatpalakodety closed 1 year ago
I am using the latest version of ngx-matomo (1.1.0). As per the documentation, I have the following set up:
app.module.ts
imports: [ MatomoModule.forRoot({ scriptUrl: '', trackers: [ { trackerUrl: '', siteId: 0 } ], routeTracking: { enable: true } }) ]
app.component.ts
import { MatomoTracker } from 'ngx-matomo'; import { AppConfigService } from './services/app-config.service'; constructor( private readonly matomoTracker: MatomoTracker, private readonly appConfigService: AppConfigService ) { this.matomoTracker.setApiUrl(this.appConfigService.matomoUrl().concat('matomo.js')); this.matomoTracker.setTrackerUrl(this.appConfigService.matomoUrl()); this.matomoTracker.setSiteId(this.appConfigService.matomoSiteId()); }
I am using an application config service to pull configurations mentioned in appConfig.json and dynamically set the Matomo Configuration, as per environment. Is there a recommended approach to set the scriptUrl, trackerUrl and siteId dynamically?
appConfig.json
scriptUrl
trackerUrl
siteId
I am using the latest version of ngx-matomo (1.1.0). As per the documentation, I have the following set up:
app.module.ts
app.component.ts
I am using an application config service to pull configurations mentioned in
appConfig.json
and dynamically set the Matomo Configuration, as per environment. Is there a recommended approach to set thescriptUrl
,trackerUrl
andsiteId
dynamically?