diff --git a/example/lib/main.dart b/example/lib/main.dart index 9d7c395..1063d44 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -7,7 +7,7 @@ import 'package:url_launcher/url_launcher.dart'; // See the docker folder for instructions on how to get a // test Matomo instance running const _matomoEndpoint = 'http://localhost:8765/matomo.php'; -const _sideId = 1; +const _sideId = "1"; const _testUserId = 'Nelson Pandela'; // Use this as dispatchSettings in MatomoTracker.instance.initialize() diff --git a/lib/src/matomo.dart b/lib/src/matomo.dart index f9bb212..6c05fab 100644 --- a/lib/src/matomo.dart +++ b/lib/src/matomo.dart @@ -55,7 +55,7 @@ class MatomoTracker { /// The ID of the website we're tracking a visit/action for. /// /// Corresponds with `idsite`. - late final int siteId; + late final String siteId; /// The url of the Matomo endpoint. /// @@ -205,7 +205,7 @@ class MatomoTracker { /// It is recommended to leave [userAgent] to `null` so it will be detected /// automatically. Future initialize({ - required int siteId, + required String siteId, required String url, bool newVisit = true, String? visitorId, diff --git a/lib/src/matomo_action.dart b/lib/src/matomo_action.dart index f92afa0..3c34639 100644 --- a/lib/src/matomo_action.dart +++ b/lib/src/matomo_action.dart @@ -206,7 +206,7 @@ class MatomoAction { return { // Required parameters - 'idsite': tracker.siteId.toString(), + 'idsite': tracker.siteId, 'rec': '1', if (nV != null && nV) 'new_visit': '1', diff --git a/test/ressources/mock/data.dart b/test/ressources/mock/data.dart index c0387f7..4760d6d 100644 --- a/test/ressources/mock/data.dart +++ b/test/ressources/mock/data.dart @@ -119,7 +119,7 @@ const matomoDispatcherToken = 'token'; // MatomoTracker const matomoTrackerContentBase = 'contentBase'; -const matomoTrackerSiteId = 1; +const matomoTrackerSiteId = "1"; const matomoTrackerScreenResolution = Size(200, 200); const matomoTrackerUrl = 'https://example.com'; const matomoTrackerContentBaseUrl = 'https://example.com';