Closed Sobhika2 closed 7 years ago
We have user coordinates (lon, lat), from mobile device using our app logic, is there way to pass this info to PIWIK and show it on the map?
Yes, this might be possible. This feature is available in our HTTP tracking API, which is used by the iOS SDK. See: https://developer.piwik.org/api-reference/tracking-api#other-parameters-require-authentication-via-token_auth
So if functions to set these values are not available in the iOS SDK yet, please consider submitting a pull request or creating an issue.
Dear @mattab ,
Thanks, but that produced some questions from my side:
And I still have old question:
Regards, Sobhika
I just realised that currently, setting location details require token_auth
authentication so this is not yet suitable for your use case, because token_auth
is private and therefore shouldn't appear in the iOS app SDK calls or in the JS calls.
-> Solution would be to make location parameters settable without requiring token_auth either by default, or to introduce a new config setting (or reuse tracking_requests_require_authentication
)
Maybe @Sobhika2 you could test this: this workaround solution should let you track city/country/region of your iOS apps users (if you know the country/city by another mean than IP addresses):
in your config/config.ini.php
below [General]
add
; Allow setting geo location (country, city, region) when tracking iOS apps
; Note: this is not recommended but temporary workaround waiting for better solution in https://github.com/piwik/piwik/issues/11563
tracking_requests_require_authentication=0
Then in your iOS Apps you can set the country / city of a user by calling the SDK method equivalent to setCustomTrackingParameter
in PHP. Then you can track country and city like setCustomTrackingParameter('city', 'Tokyo');
and setCustomTrackingParameter('country', 'Japan');
(full list of geo location parameters in API reference)
Hi @Sobhika2, just a short information on the state of the iOS SDK here. Neither version 3.x nor the new 4.x release supports setting the Geoposition parameters for an event. Please open a new issue in the piwik iOS SDK repository and we will look into adding it.
@brototyp Maybe geo location function don't need to be added to the SDK yet because currently it's not really supported by Piwik core without changing a config setting, which is not recommended. By default setting location details require token_auth authentication
but we can't put such token_auth in the iOS app compiled code.
instead we would need
@mattab Yes, thank you for the idea for the piwik/piwik-sdk-ios#153 Issue. That sounds like a really good idea!
Let's continue discussion in https://github.com/piwik/piwik-sdk-ios/issues/153
Hi All, my question is How to set location parameters (lat, long, city, region, country) from ios/android side to the Matomo dashboard. I tried to set up but by default its Unknown. As when ever i am tracking the event from web Application location is setting as (by default) "us" and automatically flag of "us" is placed on the provided place, but when using ios or Android app default value of location is unKnown.
See previous comment https://github.com/matomo-org/matomo/issues/11563#issuecomment-304547116 and also https://matomo.org/docs/geo-locate/ otherwise if you want to location to be detected automatically
Can someone explain why using JavaScript it is possible to set the user but not the location?
Hi ,
We are using the IOS SDK for tracking usage of one of our mobile application PIWIK. However, all mobile devices are localized in the US, even if we access it from Europe. This might be related to the fact that we are routed through Mobile Iron.
We tried sending the location using custom variable as below _paq.push([ 'setCustomVariable', 1 , "Location", location, "page" ]); which did not work.
This project(same source code) is used/launched/deployed on 2 different environments:
So in second case web application is launched in local mobile browser, from file:// protocol, and in addition to this all requests (PIWIK requests too) from this application goes through MobileIron proxy servers. That’s why sending window.location to PIWIK doesn’t help, cause we are sending file://folder /folder/folder as location object, and PIWIK server cannot detect our real – local IP address for location detection.
In conclusion we have question – How to enable PIWIK location detection in our case? We have user coordinates (lon, lat), from mobile device using our app logic, is there way to pass this info to PIWIK and show it on the map?
Please assist.
Regards, Sobhika