Open tushar33 opened 9 months ago
Hi @tushar33
Can you please provide a reproduction code (or at least your configuration), so I can investigate further?
Service file `import { Injectable } from '@angular/core'; import { MatomoTracker } from '@ngx-matomo/tracker';
@Injectable({ providedIn: 'root', }) export class MatomoService { constructor(private readonly tracker: MatomoTracker) {}
trackEvent(category: string, action: string, name?: string, value?: number): void { // Call trackEvent method this.tracker.trackEvent(category, action, name, value); } }`
app.module code
NgxMatomoTrackerModule.forRoot(environment?.matomoConfig)
I followed this doc https://github.com/EmmanuelRoux/ngx-matomo/blob/1.x/README.md
Screenshot of loading script
Please add the content of the configuration (environment?.matomoConfig
)
Configuration
matomoConfig: { siteId: 1, trackerUrl: 'https://sitename.matomo.cloud/matomo.php' }
Thanks.
As explained in the docs, the trackerUrl
must be
your matomo server root url
(Section Basic setup of README)
What if I want to use matomo URL as I am not setup matomo on server. Correct me if I am wrong
I don't understand your question sorry.
How is your Matomo setup? It is necessarily deployed on some url, am I wrong?
Given the url you provided, can you try with https://sitename.matomo.cloud
instead?
By using this component I am expecting logs on matomo dashboard. I want to logs user clicks so I am using this component and using the configs which are available in tracking code. Following is the tracking code available
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://sitename.matomo.cloud/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='//cdn.matomo.cloud/sitename.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
Please try using following configuration properties:
trackerUrl: 'https://sitename.matomo.cloud',
siteId: 1,
scriptUrl: '//cdn.matomo.cloud/sitename.matomo.cloud/matomo.js'
Thanks for help
Now script loading correctly but still Test installation is failed. Please check the screenshots
Do you receive tracking data? (You can check for example if you receive realtime data)
Unable to check dashboard as tracking code verification failed not allowing to check data. Please suggest how to check
Can you please try using MANUAL
installation mode?
To do so:
mode: MatomoInitializationMode.MANUAL
trackerUrl
, etc.)Hi @tushar33, is your issue solved?
Hi @EmmanuelRoux,
not checked and kept on hold due to issue. I will check and update you.
I am encountering an issue with the @ngx-matomo/tracker library (version 1.3.6) in Angular 11, where the tracking code verification fails with the error message "Tracking code verification failed. Please verify that you have installed the code correctly."
Upon inspection, I observed that the script is attempting to load from the URL https://sitename.matomo.cloud/matomo.php/matomo.js. However, attempting to access this URL results in an Internal Server Error. This discrepancy raises concerns about the accuracy of the script addition.
Notably, when inspecting the tracking code on Matomo, the provided link is formatted as //cdn.matomo.cloud/sitename.matomo.cloud/matomo.js.
I would appreciate it if you could confirm whether the script added is correct. If it is not, kindly advise on the correct method for loading the script using the URL cdn.matomo.cloud, considering the package I am currently using.