# Geofence

The Geofence feature allows administrators to define virtual boundaries on the map and monitor when devices enter or exit those areas. The Companion App continuously tracks device location and reports geofence events to the Cubilock portal in real time.\
This feature helps organizations enforce location-based policies, track device compliance, and view detailed violation timelines.

## How to Setup Geofencing

To start receiving geofence activity and geofence reports from devices, ensure the following prerequisites are met:

1. The latest Companion App is installed on the device.
2. Location permissions are fully granted to the Companion App (High-accuracy mode recommended).
3. The device has internet connectivity to sync geofence events with the server.
4. The geofence is created and assigned to the appropriate device(s) or profile(s) from the admin portal.

Once these steps are complete, geofence monitoring begins automatically.

## Creating a Geofence

Geofences can be created using two drawing tools:

#### Polygon Geofence

Select multiple points on the map to outline a custom-shaped area.

#### Circular Geofence

Click on the map to place the center point and specify a radius.

As you draw, the system automatically calculates the total area of the geofence.

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FEK8Px9KGnD5ReP0UIWbm%2FScreenshot%202025-12-11%20at%202.21.10%E2%80%AFPM.png?alt=media&#x26;token=84a69f0e-28d9-428e-84f2-7f08f38d579a" alt=""><figcaption></figcaption></figure>

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2Fy9EMuAWW6KZbrQc5p6L4%2FScreenshot%202025-12-11%20at%202.31.58%E2%80%AFPM.png?alt=media&#x26;token=5386e93c-3ef2-4163-81c7-ddc0a11d6012" alt=""><figcaption></figcaption></figure>

## Geofence Configuration

After defining the boundary, configure the following:

#### Basic Information

* Geofence name

<div align="left"><figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FHpf7BULsqlHJdzjHa19s%2FbasicInfo%20copy.png?alt=media&#x26;token=ef614bbb-dfd1-45cf-9e95-e046de54e630" alt="" width="375"><figcaption></figcaption></figure></div>

#### Scheduling

Each geofence can be active for a specific time window.\
You can configure:

* Start date
* End date
* Start time
* End time

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2Fh7b2xyDNpzwvlgpeWuAm%2FbasicInfo.png?alt=media&#x26;token=bb8dad7c-1a96-49a9-9f7b-5bf2d05ab344" alt=""><figcaption></figcaption></figure>

#### Limit to Specific Weekdays

(Optional) Activate the geofence only on selected weekdays.\
If disabled, it operates every day between the configured date range.

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FCIWTA84dg9L6rrELJu27%2FworkDays.png?alt=media&#x26;token=7a3a9823-71cb-4a0d-96cf-5d2c8f156033" alt=""><figcaption></figcaption></figure>

#### Restrict to Specific Hours

(Optional) Make the geofence active only within a defined time range on applicable days.

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2F8nrZaERlqa5yPZKzRGPW%2FScreenshot%202025-12-11%20at%202.42.20%E2%80%AFPM.png?alt=media&#x26;token=721ff2c0-4f62-4448-954c-a441731d1091" alt=""><figcaption></figcaption></figure>

### Geofence Exit Actions

When a device **exits** the defined geofence area, the system can automatically run one or more **Exit Actions**. These actions help you respond immediately if a device leaves an allowed zone.

#### Where to find it

Go to your geofence configuration screen and open:

**Geofence Exit Actions → Select actions for devices outside geofence**

#### How it works

* Exit actions trigger **automatically** when the device transitions from **inside → outside** the geofence boundary.
* You can enable **multiple actions** at the same time.
* Actions apply to the device(s) assigned to that geofence policy.

#### Available Exit Actions

**Notify Admin**

Sends an **email notification** to the admin when a device exits the geofence.

**Use this when:** you want the operations/security team to be alerted immediately.

***

**Lock Device**

Locks the device (denies device access) as soon as it leaves the geofence.

**Use this when:** devices must not be usable outside an approved location

***

**Notify Device**

Sends an **on-device notification** informing the user that the device has left the allowed area.

**Use this when:** you want the user to self-correct (return to the allowed zone) before stricter actions are taken.

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FU03tQ9Vqq02drxqnFUfQ%2Fimage%20(3).png?alt=media&#x26;token=0223e2cd-afb3-41dd-a1bf-38c6e29c34ac" alt=""><figcaption></figcaption></figure>

## Attach Devices

A geofence must be applied to devices or device groups or to take effect.\
You can attach:

* Profiles
* Device Groups
* Individual Devices

Once assigned, devices immediately begin monitoring the defined boundaries.

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FXzN4xx6aAduhFf3ozytw%2FScreenshot%202025-12-11%20at%202.22.08%E2%80%AFPM.png?alt=media&#x26;token=f5db6887-2ca2-404e-9470-87c0fe2047b8" alt=""><figcaption></figcaption></figure>

## Viewing Geofences

The Geofence overview page lists all configured geofences, along with:

* Status (Active, Expired, Deactivated)
* Compliance count
* Violation count
* Start and end dates

Clicking a geofence displays its boundary on the map, along with associated device activity.

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FmmdxIgeVTa6h2kSAyP8o%2FScreenshot%202026-01-09%20at%2010.44.03%E2%80%AFAM.png?alt=media&#x26;token=c427bb9b-5a8b-451d-a92c-f8b270e15da0" alt=""><figcaption></figcaption></figure>

## Device Activity View

The Device Activity View provides a detailed timeline of all geofence events recorded for a specific device. This view is useful for auditing movement patterns, understanding violation behavior, and validating whether devices are entering or exiting geofences according to schedule.

When you open any device under a particular geofence, the system displays:

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FYTOJnPjKRRR8Cqw2KVEC%2FScreenshot%202026-01-09%20at%2010.48.53%E2%80%AFAM.png?alt=media&#x26;token=4e5ed411-edf5-4828-91af-b2f5550bd0da" alt=""><figcaption></figcaption></figure>

### Device Information

Key identifiers for the selected device, including:

* IMEI
* Serial Number
* Total violations recorded within the selected date range

This ensures administrators can quickly verify the device being analyzed.

<div align="left"><figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FMV1bO7lubrVgOSR3ghuW%2FScreenshot%202026-01-09%20at%203.39.46%E2%80%AFPM.png?alt=media&#x26;token=3a2ad6ac-ad30-4fb4-b835-7feddabc4a2a" alt=""><figcaption></figcaption></figure></div>

### Filters

You can refine the activity results by adjusting:

* **Start Date**
* **End Date**

Only events within the selected time window will be shown in the timeline and plotted on the map.

<div align="left"><figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FonimdqMrCWUyIPU5C3xU%2FScreenshot%202025-12-11%20at%203.39.42%E2%80%AFPM.png?alt=media&#x26;token=6bf1b06d-43c3-4271-a4ae-bd74bbef9e67" alt="" width="356"><figcaption></figcaption></figure></div>

### Event Timeline

The timeline presents a chronological sequence of all geofence-related activities for the device, grouped by date. Each entry includes:

* The type of event (Entered or Exited the geofence)
* Coordinates at the moment of the event
* Exact timestamp
* Highlighted color coding (e.g., red for Exited events)

This allows administrators to immediately see when and how often the device crossed the geofence boundary.

<div align="left"><figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FUGcPlfXCoBQKLM69v5Pz%2FScreenshot%202025-12-11%20at%203.38.34%E2%80%AFPM.png?alt=media&#x26;token=3bdaab54-3cb3-4a9c-88a9-f51046314a59" alt="" width="346"><figcaption></figcaption></figure></div>

### Map View

Every event recorded in the timeline is simultaneously plotted on the map.\
The map provides:

* Pinpointed location markers for each Enter and Exit event
* A toggle for enabling or disabling the event markers
* A clear visual overlay of the geofence boundary for contextual reference

This combination of geographic visualization and event history enables accurate analysis of movement patterns and potential violations.

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FiTCaMwo4foTHzVUUzT3O%2FScreenshot%202025-12-11%20at%203.38.14%E2%80%AFPM.png?alt=media&#x26;token=16c90a56-36d0-447d-9dec-ea8929a7da73" alt=""><figcaption></figcaption></figure>

## Geofence & Compliance Reports

A **violation** occurs when a device enters or exits a geofence outside the allowed schedule.\
A **Inside Geofence** event indicates the device is behaving within expected boundaries.

The portal provides:

* A chronological timeline of events (Enter, Exit)
* Each event’s coordinates
* Timestamp
* Device details (Name, IMEI, Serial Number)

You can also toggle the map event markers for better visualization.

## Filters

Filters help you narrow down activity logs and geofence reports.\
Available filters include:

* Date Range
* Device
* Profiles
* Groups
* Event Type (Enter, Exit)

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2F2ymjZ15SfEqne04mGbVn%2FScreenshot%202026-01-09%20at%203.41.43%E2%80%AFPM.png?alt=media&#x26;token=2de6ad31-87e9-470d-a8c8-3a079d32edb9" alt=""><figcaption></figcaption></figure>

## Geofence Report

The Geofence Report screen shows aggregated geofence violations across all devices.\
You can view:

* Device name
* Serial number
* Geofence name
* Time of violation
* Activity (Enter/Exit)
* Coordinates
* Actions Taken

The report supports pagination and CSV download for external analysis.

<figure><img src="https://1920795617-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzePNJAKsgL6R-VtV2%2Fuploads%2FGIXRyQQfvd7iZYVbGrWY%2Fimage%20(4).png?alt=media&#x26;token=657c5572-c787-4a81-a89a-250c282fa378" alt=""><figcaption></figcaption></figure>

***

## Scheduled Reports

You can configure automated email delivery for geofence reports.\
Scheduled reports help administrators receive timely compliance updates without logging in to the portal.

***

## Summary

The Geofence feature provides complete visibility into device movement relative to defined boundaries. With flexible area drawing tools, scheduling, detailed violation logs, and automated reporting, administrators can easily monitor compliance and enforce location-based policies.
