Continuous Tracking Template

Continuous Tracking Template


Notes
This document is intended solely for system administrators and technical developers responsible for configuring and maintaining Transistorsoft settings. While it is accessible in the public knowledge base, it is not designed for end users or general staff. Non‑technical readers may find the content highly specialized and should not rely on it for operational guidance.

Suggested “Use Full Tracking With Battery-Friendly” Template
Click Here To Access The Actual Link to the  OpenAI  Thread


Suggested “Full Tracking but Battery-Friendly” profile

Think of this as your “FullTracking_LowRouteDetail” template for start().

These are starting values – you can tweak later by field-testing different templates.

Core movement / accuracy

SettingSuggested valueWhy
desiredAccuracyDESIRED_ACCURACY_MEDIUMGood for 200–300 m geofences; cheaper than HIGH. Recent versions also bump accuracy up internally as needed when moving. GitHub
distanceFilter50–75 mFor a 300 m radius, this is plenty. A car will cross several 50–75 m steps on approach, so geofence entry is still fast, but you’re not tracking every tiny move. GitHub
stationaryRadius25–50 mWhen they stop near the site, plugin can quickly consider them “stationary” and power down, as long as they’re not roaming around.
stopTimeout5–10 minutesAfter ~5–10 min with no significant movement, go to stationary mode and save battery; fine for employees who stay on site for hours. GitHub+1
locationUpdateInterval (Android)60,000 ms (60s)Upper bound on how often Android gives updates when moving. With distanceFilter 50–75 m, you’ll usually get distance-based triggers first, but this keeps a cap on time-based events.
fastestLocationUpdateInterval (Android)30,000 ms (30s)Prevents extremely rapid updates during GPS “bursts”.

Activity / motion & lifecycle

SettingSuggested valueWhy
activityRecognitionInterval (Android)60,000 msDon’t constantly query the motion API; once a minute is enough.
stopOnTerminatefalseContinue tracking after reboot / app swipe, which you want for auto clock-in/out. transistorsoft.github.io
startOnBoottrueSame reason as above – device restart shouldn’t break auto clocking.
preventSuspend (iOS)false (for now)Only turn this on if you find iOS is too aggressive. It keeps the JS awake more often but costs battery. Transistor Software
geofenceProximityRadius1000–1500 mEnsures the SDK starts monitoring geofences well before the user arrives, so enter triggers are prompt even in start() mode. transistorsoft.github.io
geofenceInitialTriggerEntrytrueSo when tracking starts and the employee is already inside a site, you get an immediate ENTER to clock them in.

Things to avoid if you care about battery

  • Heartbeat: don’t run heartbeatInterval every 1–2 minutes. If you must use heartbeat for daily device status, keep it to 15–30 minutes or even schedule it for specific times only.

  • preventSuspend: true unless you really need ultra-fast stationary-exit on iOS; it keeps the app much more active. Transistor Software

  • Very small distanceFilter (e.g. 5–10 m) + DESIRED_ACCURACY_HIGH: that’s when you get “Google Maps level” tracking and big battery cost.


3. How to use start() without storing travel routes

There are two layers of data to think about:

  1. On the device (inside the SDK)
    The plugin always keeps some locations in its own SQLite DB until they’re synced or purged. That’s fine – it’s local to the phone. You can control retention with things like maxDaysToPersist. npmjs.com

  2. On your backend (your ClickTime portal)
    This is where you care about not storing routes.

Option A – Easiest: don’t use the plugin’s HTTP sync at all

Do not set:

  • url

  • autoSync

  • batchSync

  • etc.

Instead:

  • Listen for geofence events and send only clock data:

BackgroundGeolocation.onGeofence(geoEvent => { const { identifier, action, location } = geoEvent; // identifier = job site ID; action = "ENTER" or "EXIT" // location is available if you want it for *this* event only. // 1) Decide if this should clock the employee in or out. // 2) Call your own API: /clock with employeeId, jobSiteId, action, timestamp. // You DON'T send every intermediate location – just this event. });
  • You can ignore the continuous onLocation events completely if all you care about is geofence enter / exit.

Result:

  • Phone may internally record locations for tracking & geofencing logic, but

  • your server never sees the route – only clock-in / clock-out events.

If you’re worried about internal DB growth, periodically:

  • use a low maxDaysToPersist (e.g. 1–3 days), or

  • call BackgroundGeolocation.destroyLocations() at a safe time (e.g. once your daily payroll export is done).

 

// Template: Continuous Tracking Template

  templateName:    "Continuous Tracking Template",
  trackingMode:      "start",           // your own field → call BackgroundGeolocation.start()

// For Android defaults
foregroundService: true,     // Always Keep it at TRUE. Do Not Change This
enableHeadless: true           // Always Keep it at TRUE. Do Not Change This 

stopOnTerminate: false,      // Always Keep it at FALSE. Do Not Change This
startOnBoot: true,               // Always Keep it at FALSE. Do Not Change This
  
// Geofences
  geofenceProximityRadius: 1500,           // required for large # of geofences 
  geofenceInitialTriggerEntry: true,        // fire ENTER immediately if already inside    Always Keep it at FALSE. Do Not Change This

  // Logging
  debug: false,
  logLevel: BackgroundGeolocation.LOG_LEVEL_INFO


  // --- Geolocation behaviour ---// Medium is usually enough for geofences + auto clocking, saves battery vs HIGH. 
  desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_MEDIUM,      


  distanceFilter: 70,              // In meters. Distance-based tracking: report when moved ~50m. Good balance car/walking.
  disableElasticity: false,     // Keep Transistorsoft’s speed-based elasticity enabled so highway driving uses larger distanceFilter automatically.
  useSignificantChangesOnly: false,     // We want real continuous tracking here, not “a few times per hour”. 

  // Android-only time-based hints (ignored when distanceFilter > 0, but good defaults):
  locationUpdateInterval: 60000,                  // 1 minute  (ignored with DF>0) but will continue if user keeps driving
  fastestLocationUpdateInterval: 5000,     // 5s   (Android only)

Geofence events (Entry/ Exit) LocationUpdateIntreval are not driven by locationUpdateInterval

Geofence events (onGeofence with ENTER / EXIT) are not driven by locationUpdateInterval. They’re driven by:

  • The OS geofencing API + Transistorsoft’s geofencing logic.

Conceptually:

  • Geofences are “watched” at the OS level.

  • When the device crosses a geofence boundary:

    • The OS / SDK generates a geofence event immediately (subject to normal GPS timing/drift).

    • The plugin calls your onGeofence callback.

    • That entry/exit is independent of the scheduled “tracking updates” from locationUpdateInterval.

So:

  • Setting locationUpdateInterval = 3 minutes

    • May reduce how often you receive regular tracking locations (onLocation),

    • But does not intentionally wait 3 minutes to deliver a geofence ENTER or EXIT.

 
  // --- Activity recognition & stop-detection ---
  stopTimeout: 5,                 // minutes in moving state before going stationary after STILL detected
  stopOnStationary: false,  // don't auto-stop, just go to stationary state and keep background service alive 
  stationaryRadius: 25,      // default; keep it tight so we re-enter moving quickly if they leave 

  // --- App lifecycle / persistence (cross-platform) ---
  stopOnTerminate: false,    Always Keep it at FALSE. Do Not Change This
  startOnBoot: true,            Always Keep it at TRUE. Do Not Change This

  // Android-only robustness
  foregroundService: true,     //Always Keep it at TRUE. Do Not Change This
  enableHeadless:     true,     //Always Keep it at TRUE. Do Not Change This

  // iOS-specific: optional heartbeat to run health checks while stationary
  preventSuspend:   true,        // allow heartbeat in background. /Do Not Change This
  heartbeatInterval: 900,       // 900s = 15 minutes (min 60s; don’t go crazy) 



  // --- Geofencing (still enabled in start()) ---
  geofenceInitialTriggerEntry: true,
  geofenceModeHighAccuracy: false,   // no need; continuous tracking already high-accuracy   
GeoFenceModeHighAccurecy: False
In Short
  1. It only really matters for Android and for startGeofences().
  2. It doesn’t buy you anything with start() (full tracking)
  3. Turning it on makes geofences much more responsive but costs more battery and shows a persistent notification.
When  false = lowest battery, ENTER/EXIT fires a bit later (must move deeper in/out of region)
if you set true for a specific client, also use:
      desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_MEDIUM,
      locationUpdateInterval: 5000,
      distanceFilter: 50

When geofenceModeHighAccuracy: true:
  1. Battery usage is higher (similar to running “real” GPS tracking more often)
  2. The user sees a persistent notification on Android because of the foreground service.
  3. Higher battery usage – closer to normal continuous tracking.
  4. Shows a persistent notification on Android (some clients may not like this)
Should you use it with start()?
NO, Not Realy

Should you use it with startGeofences()?
  1. Much more battery-friendly.
  2. No persistent Android notification (only whatever normal background behavior you configure).
  3. Good when:
  4. Your geofences are reasonably large (e.g. 200–300m+).
  5. You are OK if clock-in/out happens with a small delay (e.g. 30–120 seconds after they enter/leave).

Settings that actually help (a bit) with geofenceModeHighAccuracy = false
  1. Use a radius around 200–300m (which you’re already doing), not tiny 30–50m fences, for car arrivals.
  2. Increase geofenceProximityRadius to 5 or even 10 Kilometers, This tell the system, How Far from the Zone to Start Detecting (in Meters) 
  3. Place the geofence over the access road / gate, not in the geometric centre of a 1 km wide site.
  4. If you centre it in the middle of a huge site, the user might drive inside the physical site for some time before crossing the geofence circle.
   // No persistence. Locations are kept in memory only and discarded if the app is terminated.
  persistMode: BackgroundGeolocation.PERSIST_MODE_NONE    //value is ZERO    
  maxDaysToPersist: 2,                                 //  maxDaysToPersist = 0 → meaning no automatic purge. Do Not Change This                                  
  maxRecordsToPersist: -1                          // -1 → Unlimited persistence (no cap on record count). Do Not Change This 

    • Related Articles

    • How does location tracking work in ClickTime?

      With location tracking, you can see your team's location in real-time on a map and capture their location coordinates for reporting, all using GPS information sent from their mobile devices. How does location tracking work? The ClickTime mobile ...
    • GeoFencec() Only Template For Capturing Entry / Exit

      This document is intended solely for system administrators and technical developers responsible for configuring and maintaining the Auto Clocking settings. While it is accessible in the public knowledge base, it is not designed for end users or ...
    • GPS live Tracking.

      Why sometimes for some employees ClickTime is not tracking the employee's movements during the shifts? It is only tracking clock in and out time? Possible reasons Possible reasons why you can not see the employee route and movements on Google maps ...
    • Mobile App and Location Tracking Frequency

      The ClickTime mobile app uses GPS data to track your staff’s locations. Location tracking allows organisation owners and managers to view the current locations of their staff, and their previous routes, and display time stamps showing where users ...
    • Common Reasons Location Tracking and Auto Clocking Not Working

      A list of all scenarios that can cause location tracking to be lost on or the Auto Clock in/out time dose not work and how to prevent them Android auto enabled power save mode Weak GPS Signal App closed down or phone switched off Location permission ...