Custom tracking parameters not working as documented

I am trying to use custom tracking parameters in the way described here:

(under “Sending custom events”). An example of this request is:

let event = Event(tracker: MatomoTracker.shared, action: ["App Launched"], eventCategory: "Basic", eventAction: "App Launched", eventName: "App Launched", customTrackingParameters: ["version": Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String])
        MatomoTracker.shared.track(event)

But I don’t see these anywhere, neither in the admin UI, nor in the database directly. Since this is a modification of the original example, in theory this should work fine, but it doesn’t. I’ve also tried the original example provided on GitHub with the same result: I can’t find the custom tracking parameters anywhere in Matomo.

Are there other troubleshooting steps? Is there something I’m missing? Where should these parameters appear in Matomo?

Hi @severdia, thanks for asking this question.
I just tried out exactly your code in the example app for the iOS SDK and it tracked perfectly fine. You can have a look at the tracked data here.

This is actually how it looks like:

Can you try again and check the visitor log on your server?

If you still can’t see anything there please check the following:

  • Did you setup the MatomoTracker.shared instance properly?
  • Per default, the SDK only dispatches events every 30 seconds. Details see here
  • Is your Server Apple Transport Security compatible or is AST disabled?
  • Enable verbose logging and have a look if anything is shown in the logs.

Best luck!

1 Like

Thank you for replying!

On your screenshot, there’s no custom tracking parameter (the version in this case). We have exactly the same reporting: “Basic - App Launched - App Launched”, but we need to also see the version.

As for your questions:

  • We setup the MatomoTracker.shared instance properly, the reporting itself does work, but we can’t find the custom parameters. We see category, action, and event name.
  • 30 seconds dispatch is fine, and we see the events, but not the custom tracking parameters inside them.
  • Yes, there no problem with AST

We tried verbose logging, everything looks fine:

MatomoTracker [I] Start dispatching events
MatomoTracker [I] Dispatched batch of 1 events.
MatomoTracker [I] Finished dispatching events
MatomoTracker [I] No need to dispatch. Dispatch queue is empty.

Any ideas on what to do next?

Hi @severdia,

oh, shoot. I think I just read your question completely wrong :blush:
I think the documentation for the custom tracking parameters is a bit unspecific there. You can only add parameters that are defined in the official API. This feature is there to used features that are in the API but not yet supported by the SDK. It’s not possible to define your own parameters there.

If you are searching for a way to track the iOS version or the version of the app the user is using, have a look at the custom dimension features and this short paragraph in the FAQ. That might be the thing you are searching for.

Best, Cornelius

Yes, that’s what I was trying to do. Any idea when/if that will be supported by the SDK? That would be the proper way to track events, but it looks like dimensions might work. However, when trying to use custom dimensions to track user-entered search terms, it seems action dimensions are the best way to do this (since the belong to specific actions rather than the app run cycle) and I thought it would be linked to each single action. But I’m getting errors using those:

“Action ‘getCustomDimension’ not found in the module ‘CustomDimensions’” and “Action ‘getCustomDimension’ not found in the module ‘CustomDimensions’”

I tried to move those to the visit dimensions but, as I expected, every new search and article opening overrides those values for a visit, so you only see the last values used in that visit (the app run cycle) instead of all the values users have submitted. Is there a better way to do this or is outside the capabilities of Matomo? Seems like a really simple thing to implement on a website, but doesn’t work at all in the SDK.