EmmanuelRoux / ngx-matomo-client

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

ngx-matomo-tracker not setting trackerUrl #73

Closed GabriMagic closed 11 months ago

GabriMagic commented 11 months ago

Good night! I am new into this product as Matomo and his libs, I am trying to integrate it into my Angular 9 application, I have this configuration:

    "@ngx-matomo/router": "^1.3.6",
    "@ngx-matomo/tracker": "^1.3.6",
    matomoUrl: 'http://localhost:81',
    matomoSiteId: '1',
        ...
        NgxMatomoTrackerModule.forRoot({
            trackerUrl: environment.matomoUrl,
            siteId: environment.matomoSiteId
        }),
        NgxMatomoRouterModule
        ...

And I can resolve correctly the matomo.js file: image

But when it exceutes and try to send data to my matomo server it calls to http://localhost:4200 instead of http://localhost:81/atomo.php as show below

telegram-cloud-document-4-5958331112387252932

I don´t know if is there any problem with the version 1.3.6. or I am missing some configuration but if I add the script manually to the index.html it works propperly, I couldn't find where the error could be and I hope if anyone can help me with this.

Thanks in advance

GabriMagic commented 11 months ago

I was debugging the entire matomo.js file looking for the "trackerUrl" and I found that it is not including the "setTrackerUrl" property on the flow:

image

Despite of this, the action wouldn't be sended to the correct server never.