Closed berger89 closed 5 years ago
You would use setApplicationDomain
with a domain name not just a protocol, i.e. either some.domain.com
or https://some.domain.com
.
Either way it looks like the code requires the tracked URL to use either ftp
, http
or https
.
https://github.com/matomo-org/piwik-sdk-android/blob/a3c0a4189f58ec88199bf54b74f5bf84a722edba/piwik-sdk/src/main/java/org/piwik/sdk/Tracker.java#L445
While we could change that I think there were some server-side requirements when I last checked, as in, if we don't use one of those protocols, the server does not track the visit/event. @mattab Am I right?
@berger89 Can you elaborate on your use-case for this?
@d4rken on the server side AFAIK our check is this one: https://github.com/matomo-org/matomo/blob/3e524abc661d401c55ec8b3439a0125eae0f088d/core/UrlHelper.php#L135-L137
ie. return preg_match('~^(([[:alpha:]][[:alnum:]+.-]*)?:)?//(.*)$~D', $url, $matches) !== 0
so we accept URLs with any protocol.
@d4rken
The problem is that in the method setApplicationDomain
the getApplicationBaseURL
is called, in which the parameter baseurl
/mApplicationDomain
is prefixed with an http.
Is it possible to change the protocol? For example to use "rest://example/id/..."? When I set.setApplicationDomain("rest://"), an http: is always prefixed...