EmmanuelRoux / ngx-matomo-client

Matomo analytics client for Angular applications
https://matomo.org/
MIT License
74 stars 16 forks source link

Logging on secondary siteId #66

Closed PerKlitgaard closed 1 year ago

PerKlitgaard commented 1 year ago

Im not sure if its the right place to ask for a feature, or if its allready possible. :-) The Matomo site script has a feature to log on a secondary siteId. But is this possible in ngx-matomo? or is it af feature that have been thought about.

EmmanuelRoux commented 1 year ago

Hi @PerKlitgaard

It's possible. Instead of using a simple configuration like this:

    NgxMatomoTrackerModule.forRoot({
      siteId: 'MAIN_SITE_ID',
      trackerUrl: 'MAIN_TRACKER_URL',
    }),

You can define multiple trackers config:

NgxMatomoTrackerModule.forRoot({
      trackers: [
        {
          siteId: 'SITE_ID_FOR_TRACKER_1',
          trackerUrl: 'TRACKER_1_URL',
        },
        {
          siteId: 'SITE_ID_FOR_TRACKER_2',
          trackerUrl: 'TRACKER_2_URL',
        },
      ],
      // Following is OPTIONAL. Script is by default obtained from the first tracker in the list.
      // But if you want it from another tracker or another location, provide its url here:
      scriptUrl: '<path to matomo.js>',
    }),
PerKlitgaard commented 1 year ago

Hi Emmanuel Thaks a lot I will try that

And thank you for a good package

/Per

EmmanuelRoux commented 1 year ago

Thanks, I'll let you close this issue once everything is ok for you 😉