Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10503] Android: Only send ti.geo analytics event once when user sets a ti.geolocation callback

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-04T15:38:43.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Sprint 2012-18 API
ComponentsAndroid
Labelsapi
ReporterChung Liu
AssigneeHieu Pham
Created2012-08-20T15:21:06.000+0000
Updated2017-03-06T22:38:16.000+0000

Description

Currently, when user sets ti.geolocation, ti.geo analytics events are sent for every callback. We only care about one lat/long pair, and it's wasteful to send all ti.geo info. Testing steps: 1. Launch a simple app with this code in production (Package in iOS/Android App store)
Ti.Geolocation.addEventListener('location', function(e) {
});
2. Drive around a little bit to trigger location change (home -> work. etc.) 3. Put app's name and GUID in this ticket so we can look up analytics events that was fired.

Comments

  1. Chung Liu 2012-08-21

    Neeraj -- Yes, don't send repeated ti.geo analytics events every time the location changes. Just send one single ti.geo analytics event (so we can establish the country/city of the session). We don't need to automatically track the movements of the user through analytics. If the app needs to record the movements of the user, it can send its own data by making explicit calls. Currently we have sessions with thousands of ti.geo events that are counted against an app's analytics quota, don't add any value, and use up a device's battery and data plan.
  2. Hieu Pham 2012-08-30

    Test case is missing.
  3. Opie Cyrus 2012-09-04

    Test case started, drove to nearby location and back with app running. ID: com.appcelerator.timob10503 GUID: b35574ca-868d-43f9-8201-beace15b7f10
  4. Chung Liu 2012-09-04

    Looks good. For some reason the IP address is an Orlando FL address, but the GPS coordinates are Allen TX. Looks like only one ti.geo was sent at the start of the session. Here's the actual analytics data that was sent: 10.250.50.160-12.json.txt:{"id":"c64890d9-14c2-4b15-b6c7-c7a3eaeea353:8a8d4496fe53e764","sid":"4284f1bb-fa09-4d7f-af6c-a0b4945be9dc","ts":"2012-09-04T19:08:17.682+0000","event":"ti.enroll","data":{"platform":"android","osarch":"ARMv7 Processor rev 10 (v7l)","model":"Galaxy Nexus","mac_addr":"a0:0b:ba:e7:56:96","previous_mid":"","oscpu":2,"ostype":"32bit","deploytype":"test","app_id":"com.appcelerator.timob10503","app_name":"timob10503"},"seq":1,"mid":"8a8d4496fe53e764","ver":"2","type":"ti.enroll","aguid":"b35574ca-868d-43f9-8201-beace15b7f10"} 10.250.50.160-12.json.txt:{"city":"Orlando","region_code":"FL","country_code":"US","country_name":"United States","postal_code":"","latitude":28.538299560547,"longitude":-81.379203796387,"area_code":407,"continent_code":"NA","ip_address":"208.54.86.253","region_name":"Florida","id":"05e5d48c-7685-47d4-8176-c0d23b6c0103:8a8d4496fe53e764","sid":"4284f1bb-fa09-4d7f-af6c-a0b4945be9dc","ts":"2012-09-04T19:08:17.768+0000","event":"ti.start","data":{"platform":"android","os":"Android","model":"Galaxy Nexus","tz":-360,"nettype":"MOBILE","deploytype":"test","app_version":"1.0","osver":"4.1.1","un":"android-build","version":"2.2.0"},"seq":2,"mid":"8a8d4496fe53e764","ver":"2","type":"ti.start","aguid":"b35574ca-868d-43f9-8201-beace15b7f10"} 10.250.50.160-12.json.txt:{"id":"8dffe736-72fd-4a52-878c-e7074a00f3aa:8a8d4496fe53e764","sid":"4284f1bb-fa09-4d7f-af6c-a0b4945be9dc","ts":"2012-09-04T19:08:17.925+0000","event":"ti.geo","data":{"to":{"timestamp":1346780580945,"longitude":-96.7026004,"latitude":33.0936855,"accuracy":1316,"speed":0,"altitude":0,"heading":0}},"seq":3,"mid":"8a8d4496fe53e764","ver":"2","type":"ti.geo","aguid":"b35574ca-868d-43f9-8201-beace15b7f10"} 10.250.50.160-12.json.txt:{"id":"8c85e8c7-787b-4736-8f57-327ed3c744a8:8a8d4496fe53e764","sid":"4284f1bb-fa09-4d7f-af6c-a0b4945be9dc","ts":"2012-09-04T19:22:29.917+0000","event":"ti.end","data":{"value":""},"seq":4,"mid":"8a8d4496fe53e764","ver":"2","type":"ti.end","aguid":"b35574ca-868d-43f9-8201-beace15b7f10"} {"results":[{"locations":[{"latLng":{"lng":-96.7026,"lat":33.093685},"adminArea4":"Collin","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"Allen","street":"S Alma Dr","adminArea1":"US","adminArea3":"TX","type":"s","displayLatLng":{"lng":-96.7026,"lat":33.093685},"linkId":0,"postalCode":"75013","sideOfStreet":"N","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"ADDRESS","geocodeQualityCode":"L1BAA","mapUrl":"http://www.mapquestapi.com/staticmap/v3/getmap?type=map&size=225,160&pois=purple-1,33.093685,-96.7026,0,0|¢er=33.093685,-96.7026&zoom=12&key=Dmjtd|lu612hurng,as=o5-50zah&rand=1369286607","adminArea3Type":"State"}],"providedLocation":{"latLng":{"lng":-96.7026004,"lat":33.0936855}}}],"options":{"ignoreLatLngInput":false,"maxResults":-1,"thumbMaps":true},"info":{"copyright":{"text":"© 2012 MapQuest, Inc.","imageUrl":"http://api.mqcdn.com/res/mqlogo.gif","imageAltText":"© 2012 MapQuest, Inc."},"statuscode":0,"messages":[]}}
  5. Chung Liu 2012-09-04

    Note for QE: when testing this, make sure you are packaging for distribution (deploytype production) instead of testing on device (deploytype test) otherwise the events won't be counted or show up in the analytics dashboard UI.
  6. Lee Morris 2017-03-06

    Closing ticket due to time passed.

JSON Source