matomo-org / matomo-sdk-android

SDK for Android to measure your apps with Matomo. Works on Android phones, tablets, Fire TV sticks, and more!
BSD 3-Clause "New" or "Revised" License
386 stars 163 forks source link

trackOutlink() is not working #396

Open JeffreyVanelderenACA opened 1 year ago

JeffreyVanelderenACA commented 1 year ago

Version: implementation 'com.github.matomo-org:matomo-sdk-android:4.1.4

I'm using the iOS and Android SDK for my React Native app. I wrapped the SDK's and everything is working (initialize, trackCategory, ... ) and showing up on the matomo dashboard. Only trackOutlink is not working. I verified that the method is called and executed, but it is never showing up on the dashboard.

@ReactMethod
    fun trackOutlink(args: ReadableMap) {
        val link = args.getString("link");
        getTrackHelper()?.outlink(URL(link))?.with(sharedMatomoTracker);
    }

    private fun getTrackHelper(): TrackHelper? {
        if (sharedMatomoTracker == null) {
            throw RuntimeException("Tracker must be initialized before usage")
        }
        var trackHelper = TrackHelper.track()
        for ((key, value) in customDimensions.entries) {
            trackHelper = trackHelper.dimension(key, value)
        }
        return trackHelper
    }

Dashboard (filtered for the whole month):

Screenshot 2023-01-16 at 15 56 28
hannesa2 commented 1 year ago

@d4rken knows the most about the API

d4rken commented 1 year ago

Looks okay afaict. Check in debug logs if data is being dispatched to your server. Is the URL format valid? I faintly remember that a few years ago the tracker was picky about the URL format being correct.

JeffreyVanelderenACA commented 1 year ago

@d4rken The URL's should be valid, it's an URL like https://apps.xxxx.xxx/webportal, I've tried some other dummy URL's as well but it's not showing up. I also don't think the URL class would take invalid url's

JeffreyVanelderenACA commented 1 year ago

Any updates on this issue?

JeffreyVanelderenACA commented 1 year ago

@d4rken Hi, can you provide a status update if any?

d4rken commented 1 year ago

I have not looked into it further. Currently have no extra time for this project.