Class MatomoTrackerProperties
These properties can be configured in the application.properties file. For example:
matomo.tracker.api-endpoint=https://your-matomo-domain.example/matomo.php matomo.tracker.default-site-id=1 matomo.tracker.default-auth-token=1234567890abcdef1234567890abcdef matomo.tracker.enabled=true matomo.tracker.connect-timeout=10s matomo.tracker.socket-timeout=30s matomo.tracker.proxy-host=proxy.example.com matomo.tracker.proxy-port=8080 matomo.tracker.proxy-username=proxyuser matomo.tracker.proxy-password=proxypassword matomo.tracker.user-agent=MatomoJavaClient matomo.tracker.log-failed-tracking=true matomo.tracker.disable-ssl-cert-validation=true matomo.tracker.disable-ssl-host-validation=true matomo.tracker.thread-pool-size=2
- See Also:
-
MatomoTrackerAutoConfigurationTrackerConfiguration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThe Matomo Tracking HTTP API endpoint.The timeout until a connection is established.The authorization token (parameter token_auth) to use if not specified explicitly.The default ID of the website that will be used if not specified explicitly.Disables SSL certificate validation.Disables SSL host verification.Allows to stop the tracker to send requests to the Matomo endpoint.Logs if the Matomo Tracking API endpoint responds with an erroneous HTTP code.The hostname or IP address of an optional HTTP proxy.The corresponding password for the basic auth proxy user.The port of an HTTP proxy.If the HTTP proxy requires a username for basic authentication, it can be configured here.The socket timeout (SO_TIMEOUT), which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.The thread pool size for the async sender.A custom user agent to be set.voidsetApiEndpoint(String apiEndpoint) The Matomo Tracking HTTP API endpoint.voidsetConnectTimeout(Duration connectTimeout) The timeout until a connection is established.voidsetDefaultAuthToken(String defaultAuthToken) The authorization token (parameter token_auth) to use if not specified explicitly.voidsetDefaultSiteId(Integer defaultSiteId) The default ID of the website that will be used if not specified explicitly.voidsetDisableSslCertValidation(Boolean disableSslCertValidation) Disables SSL certificate validation.voidsetDisableSslHostVerification(Boolean disableSslHostVerification) Disables SSL host verification.voidsetEnabled(Boolean enabled) Allows to stop the tracker to send requests to the Matomo endpoint.voidsetLogFailedTracking(Boolean logFailedTracking) Logs if the Matomo Tracking API endpoint responds with an erroneous HTTP code.voidsetProxyHost(String proxyHost) The hostname or IP address of an optional HTTP proxy.voidsetProxyPassword(String proxyPassword) The corresponding password for the basic auth proxy user.voidsetProxyPort(Integer proxyPort) The port of an HTTP proxy.voidsetProxyUsername(String proxyUsername) If the HTTP proxy requires a username for basic authentication, it can be configured here.voidsetSocketTimeout(Duration socketTimeout) The socket timeout (SO_TIMEOUT), which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.voidsetThreadPoolSize(Integer threadPoolSize) The thread pool size for the async sender.voidsetUserAgent(String userAgent) A custom user agent to be set.
-
Constructor Details
-
MatomoTrackerProperties
public MatomoTrackerProperties()
-
-
Method Details
-
getApiEndpoint
The Matomo Tracking HTTP API endpoint. Example: https://your-matomo-domain.example/matomo.php -
getDefaultSiteId
The default ID of the website that will be used if not specified explicitly. -
getDefaultAuthToken
The authorization token (parameter token_auth) to use if not specified explicitly. -
getEnabled
Allows to stop the tracker to send requests to the Matomo endpoint. -
getConnectTimeout
The timeout until a connection is established.A timeout value of zero is interpreted as an infinite timeout. A `null` value is interpreted as undefined (system default if applicable).
Default: 10 seconds
-
getSocketTimeout
The socket timeout (SO_TIMEOUT), which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.A timeout value of zero is interpreted as an infinite timeout. A `null value is interpreted as undefined (system default if applicable).
Default: 30 seconds
-
getProxyHost
The hostname or IP address of an optional HTTP proxy.proxyPortmust be configured as well -
getProxyPort
The port of an HTTP proxy.proxyHostmust be configured as well. -
getProxyUsername
If the HTTP proxy requires a username for basic authentication, it can be configured here. Proxy host, port and password must also be set. -
getProxyPassword
The corresponding password for the basic auth proxy user. The proxy host, port and username must be set as well. -
getUserAgent
A custom user agent to be set. Defaults to "MatomoJavaClient" -
getLogFailedTracking
Logs if the Matomo Tracking API endpoint responds with an erroneous HTTP code. Defaults to false. -
getDisableSslCertValidation
Disables SSL certificate validation. This is useful for testing with self-signed certificates. Do not use in production environments. Defaults to false.Attention: This slows down performance
- See Also:
-
disableSslHostVerification
-
getDisableSslHostVerification
Disables SSL host verification. This is useful for testing with self-signed certificates. Do not use in production environments. Defaults to false.Attention: This slows down performance
- See Also:
-
disableSslCertValidation
-
getThreadPoolSize
The thread pool size for the async sender. Defaults to 2.Attention: If you use this library in a web application, make sure that this thread pool does not exceed the thread pool of the web application. Otherwise, you might run into problems.
-
setApiEndpoint
The Matomo Tracking HTTP API endpoint. Example: https://your-matomo-domain.example/matomo.php -
setDefaultSiteId
The default ID of the website that will be used if not specified explicitly. -
setDefaultAuthToken
The authorization token (parameter token_auth) to use if not specified explicitly. -
setEnabled
Allows to stop the tracker to send requests to the Matomo endpoint. -
setConnectTimeout
The timeout until a connection is established.A timeout value of zero is interpreted as an infinite timeout. A `null` value is interpreted as undefined (system default if applicable).
Default: 10 seconds
-
setSocketTimeout
The socket timeout (SO_TIMEOUT), which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.A timeout value of zero is interpreted as an infinite timeout. A `null value is interpreted as undefined (system default if applicable).
Default: 30 seconds
-
setProxyHost
The hostname or IP address of an optional HTTP proxy.proxyPortmust be configured as well -
setProxyPort
The port of an HTTP proxy.proxyHostmust be configured as well. -
setProxyUsername
If the HTTP proxy requires a username for basic authentication, it can be configured here. Proxy host, port and password must also be set. -
setProxyPassword
The corresponding password for the basic auth proxy user. The proxy host, port and username must be set as well. -
setUserAgent
A custom user agent to be set. Defaults to "MatomoJavaClient" -
setLogFailedTracking
Logs if the Matomo Tracking API endpoint responds with an erroneous HTTP code. Defaults to false. -
setDisableSslCertValidation
Disables SSL certificate validation. This is useful for testing with self-signed certificates. Do not use in production environments. Defaults to false.Attention: This slows down performance
- See Also:
-
disableSslHostVerification
-
setDisableSslHostVerification
Disables SSL host verification. This is useful for testing with self-signed certificates. Do not use in production environments. Defaults to false.Attention: This slows down performance
- See Also:
-
disableSslCertValidation
-
setThreadPoolSize
The thread pool size for the async sender. Defaults to 2.Attention: If you use this library in a web application, make sure that this thread pool does not exceed the thread pool of the web application. Otherwise, you might run into problems.
-