# 🆕 \[NEW PLUGIN\] Geofence - Trigger an event when entering or leaving a zone!

**URL:** <https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022>\
**Category:** Showcase\
**Created:** [December 28, 2021, 8:59pm UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022 "2021-12-28T20:59:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![vnihoul77](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vnihoul77/32/241345_2.png) [@vnihoul77](https://forum.bubble.io/u/vnihoul77)\
**Post date:** [December 28, 2021, 8:59pm UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/1 "2021-12-28T20:59:02Z")

</div>

## ![iFrame](https://ottho.notion.site/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fde984b5d-b3db-4b0e-8d3a-3966eb2f0506%2FLogo_Plugin_Geofence.gif?table=block&id=b2bcbd76-936b-42a0-94ca-232101c93f78&spaceId=4a77fb5c-5e51-4b59-8d1e-0269b914e970&userId=&cache=v2) **GeoFence Complete**

Hi there!  
We just release this new plugin to the Bubble marketplace 🎅 !

This plugin allows to watch a dynamic geographic point and trigger an event when it enters or leaves a zone. Zones can be defined as unique or list of custom polygons or radius around a point. Highly customizable and complete documentation.

[![button_try-the-demo-app](https://us1.discourse-cdn.com/bubble/original/3X/c/c/cc99557efbd645aa9ff69319346d67692c2123b5.png)](https://geofence-plugin.bubbleapps.io/version-test)

### Main features

➡ Watch a dynamic point  
➡ Use of raw coordinates possible  
➡ Trigger can be a fixed point or a custom polygon  
➡ Can trigger on a list of points/polygons  
➡ Calculate distance from the trigger point  
➡ Can retrieve in which trigger point it is  
➡ Expose the actual trigger point unique ID  
➡ Can use a different trigger radius for each trigger point  
➡ Multi-unit support (Metric, Imperial, Nautical)  
➡ No need for Google Maps API  
➡ Calculate distance between two coordinates without Google Maps API (in workflows - front and backend - and as a visual element)  
➡ Complete documentation

![image](https://ottho.notion.site/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F2c15a6b2-176a-4880-9c4e-41c2f550b27d%2Fezgif-7-5910b2653f.gif?table=block&id=fd0432fa-f938-4d8b-be6f-67e999bc653b&spaceId=4a77fb5c-5e51-4b59-8d1e-0269b914e970&userId=&cache=v2)

![ezgif-7-a0f6fd1a24](https://ottho.notion.site/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F39e35cde-018e-4063-9d6f-3de6c845ec80%2Fezgif-7-a0f6fd1a24.gif?table=block&id=ac8f8a49-a9ff-435a-9aeb-a44a8470d303&spaceId=4a77fb5c-5e51-4b59-8d1e-0269b914e970&userId=&cache=v2)

💲The plugin is available for $3/month or $19 for a lifetime license.

📘 We offer full documentation with the plugin and forum support.

## LINKS

🔗 Plugin page: [https://bubble.io/plugin/embed–iframe-dete…](https://bubble.io/plugin/1640161444196x288791162037207040)

🔗 Demo application: [https: //plugin-demo-iframe.bubbleapps …](https://geofence-plugin.bubbleapps.io/version-test)  
🔗 Demo editor: [https://bubble.io/page?name=index&id…](https://bubble.io/page?type=page&name=index&id=geofence-plugin)

🔗 Documentation: [https://www.notion.so/Embed-iFrame-Detector-…](https://ottho.notion.site/Geofence-Complete-b2bcbd76936b42a094ca232101c93f78)

## 🎁 WIN IT

The first 2 people to suggest an improvement track will have a free lifetime license!

This plugin is made by the French platform [Ottho](https://app.ottho.tools/?parrain=vnihoul77)

[![ottho](https://us1.discourse-cdn.com/bubble/original/3X/9/d/9d2c3da7243c7d86ddcf41ed7d1b48c69a49fd96.png) ](https://app.ottho.tools/?parrain=vnihoul77)

---

<div class="post-metadata">

**Author:** ![MarkusBoostedApp](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/markusboostedapp/32/54395_2.png) [@MarkusBoostedApp](https://forum.bubble.io/u/MarkusBoostedApp)\
**Post date:** [December 28, 2021, 10:25pm UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/2 "2021-12-28T22:25:23Z")

</div>

Awesome plugin!

Improvement: Icon could be user’s profile picture and zone pointer could be custom icon too.

---

<div class="post-metadata">

**Author:** ![equibodyapp](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/equibodyapp/32/159574_2.png) [@equibodyapp](https://forum.bubble.io/u/equibodyapp)\
**Post date:** [December 28, 2021, 10:54pm UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/3 "2021-12-28T22:54:30Z")

</div>

I think the map and icons are ZQ’s mapbox plugin 😉

Would be good to have a start/stop track user action and an event ‘when user location changes’ so you don’t need another plugin to get those details.

For instance -

1. start tracking user
2. when user location changes save lat and long to Bubble database
3. watch fields set to these lat and long fields in bubble database

I know you can use the bubble native ‘current geographic position’ but I don’t find that highly accurate and you also can’t save that every time it changes to call on it later (for instance user tracking by a different user).

---

<div class="post-metadata">

**Author:** ![doublejay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/doublejay/32/132501_2.png) [@doublejay](https://forum.bubble.io/u/doublejay)\
**Post date:** [December 29, 2021, 2:44am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/4 "2021-12-29T02:44:34Z")

</div>

How might I “watch a field” in bubble?

---

<div class="post-metadata">

**Author:** ![equibodyapp](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/equibodyapp/32/159574_2.png) [@equibodyapp](https://forum.bubble.io/u/equibodyapp)\
**Post date:** [December 29, 2021, 5:24am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/5 "2021-12-29T05:24:37Z")

</div>

I’m specifically referencing this plugin and it’s functionality.

---

<div class="post-metadata">

**Author:** ![vnihoul77](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vnihoul77/32/241345_2.png) [@vnihoul77](https://forum.bubble.io/u/vnihoul77)\
**Post date:** [December 29, 2021, 8:21am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/6 "2021-12-29T08:21:51Z")

</div>

That’s indeed a very good idea @equibodyapp.

Theoretically, you could do it by setting up the plugin with as a watchpoint the “Current User location” and as the trigger point also the first “Current User location” when the page is loaded (must be not dynamic so you could save it in a state) and then set up the radius when you should trigger the “User left” zone.  
But it could be done in an easier way! I’ll keep it in mind, thanks!

---

<div class="post-metadata">

**Author:** ![vnihoul77](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vnihoul77/32/241345_2.png) [@vnihoul77](https://forum.bubble.io/u/vnihoul77)\
**Post date:** [December 29, 2021, 8:23am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/7 "2021-12-29T08:23:28Z")

</div>

Can you elaborate?  
The plugin allows you to watch if a geographic point enters/leaves/gets closer to another point or area 🙂

---

<div class="post-metadata">

**Author:** ![doublejay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/doublejay/32/132501_2.png) [@doublejay](https://forum.bubble.io/u/doublejay)\
**Post date:** [December 29, 2021, 10:39am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/8 "2021-12-29T10:39:03Z")

</div>

Ah. Would be cool if bubble allowed us to watch for changes to a particular data field and run workflows if edited.

---

<div class="post-metadata">

**Author:** ![doublejay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/doublejay/32/132501_2.png) [@doublejay](https://forum.bubble.io/u/doublejay)\
**Post date:** [December 29, 2021, 10:39am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/9 "2021-12-29T10:39:47Z")

</div>

Gotcha. I thought she was referencing a feature bubble had to “watch for changes to a data field@ and run actions off of that

---

<div class="post-metadata">

**Author:** ![vnihoul77](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vnihoul77/32/241345_2.png) [@vnihoul77](https://forum.bubble.io/u/vnihoul77)\
**Post date:** [December 29, 2021, 10:56am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/10 "2021-12-29T10:56:35Z")

</div>

There is! 🥳  
Look at the “Trigger custom event when data changes” workflow 🙂

---

<div class="post-metadata">

**Author:** ![doublejay](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/doublejay/32/132501_2.png) [@doublejay](https://forum.bubble.io/u/doublejay)\
**Post date:** [December 29, 2021, 11:01am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/11 "2021-12-29T11:01:36Z")

</div>

Ooh! Will check out thanks

---

<div class="post-metadata">

**Author:** ![vnihoul77](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vnihoul77/32/241345_2.png) [@vnihoul77](https://forum.bubble.io/u/vnihoul77)\
**Post date:** [December 29, 2021, 3:54pm UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/12 "2021-12-29T15:54:28Z")

</div>

You’re welcome 😃

---

<div class="post-metadata">

**Author:** ![equibodyapp](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/equibodyapp/32/159574_2.png) [@equibodyapp](https://forum.bubble.io/u/equibodyapp)\
**Post date:** [December 29, 2021, 9:13pm UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/13 "2021-12-29T21:13:02Z")

</div>

Yep like @vnihoul77 said in your backend workflows you can create database triggers 🙂

---

<div class="post-metadata">

**Author:** ![technoswift](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/technoswift/32/100188_2.png) [@technoswift](https://forum.bubble.io/u/technoswift)\
**Post date:** [January 3, 2022, 7:05am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/14 "2022-01-03T07:05:29Z")

</div>

Wow !! this is something we needed in our App, will check out soon !  
Hoping we can trigger an event to “go to a URL” as soon as user is at particular location/polygon.

---

<div class="post-metadata">

**Author:** ![vnihoul77](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vnihoul77/32/241345_2.png) [@vnihoul77](https://forum.bubble.io/u/vnihoul77)\
**Post date:** [January 5, 2022, 2:17pm UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/15 "2022-01-05T14:17:55Z")

</div>

Indeed you can! Great to hear 😄

---

<div class="post-metadata">

**Author:** ![zach8](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/zach8/32/111595_2.png) [@zach8](https://forum.bubble.io/u/zach8)\
**Post date:** [January 8, 2022, 10:46pm UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/16 "2022-01-08T22:46:12Z")

</div>

This is great thanks so much. Geofencing is crucial for so many real-world applications, and this seems to make it really easy.

Not sure if I missed it, but for my distinct purposes it would be great to have an elapsed-time element as well. Would be good to be able to define events based on how long a user has been within a zone, and also would be great to have the option to index duration of each “visit” to the defined zone.

---

<div class="post-metadata">

**Author:** ![gonvaz](https://avatars.discourse-cdn.com/v4/letter/g/c5a1d2/32.png) [@gonvaz](https://forum.bubble.io/u/gonvaz)\
**Post date:** [March 17, 2022, 9:06am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/17 "2022-03-17T09:06:04Z")

</div>

@zach8

Did you figure this out yet? is it possible?

---

<div class="post-metadata">

**Author:** ![zach8](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/zach8/32/111595_2.png) [@zach8](https://forum.bubble.io/u/zach8)\
**Post date:** [March 17, 2022, 1:25pm UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/18 "2022-03-17T13:25:41Z")

</div>

I didn’t wind up exploring this option. I’m still a few months out from implementing, but for now I have been looking at how to achieve this with Leafy Maps or Zeroqode Google map extender.

I am steering clear of mapbox and other services that require you to manage a whole other data set outside of Bubble. Makes it more time-consuming and less efficient to integrate geographic data because these plugins don’t really let you integrate a map service with bubble. Instead they just let you display a map on your bubble site, but all the data on the still map has to be managed on a separate platform.

Fwiw, the map solution plugins that are offered right now, are all lacking if you just want to use Bubble.

---

<div class="post-metadata">

**Author:** ![alfonso.galindo](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@alfonso.galindo](https://forum.bubble.io/u/alfonso.galindo)\
**Post date:** [December 29, 2023, 6:49am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/19 "2023-12-29T06:49:36Z")

</div>

hi @vnihoul77 , in my application, users’ latest locations (lat/long) are saved to the data base with the background tracking functionality. I need to send them a push alert if they get inside the geofence (so this could happen when the app is not running). for this, I would need to evaluate whether their latest coordinates are within the geofence, in the back end. I’ve been testing the app and this doesn’t seem to be possible, or am I missing something?

btw the plugin works great when I trigger the geofence alert while using the app… I hope there’s a way to do this on the background (in the back end) as well…

---

<div class="post-metadata">

**Author:** ![vnihoul77](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/vnihoul77/32/241345_2.png) [@vnihoul77](https://forum.bubble.io/u/vnihoul77)\
**Post date:** [January 1, 2024, 10:34am UTC](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022/20 "2024-01-01T10:34:43Z")

</div>

Unfortunately this is not possible do to Bubble’s limitations 😶

[Next page](https://forum.bubble.io/t/new-plugin-geofence-trigger-an-event-when-entering-or-leaving-a-zone/184022.md?page=2)
