Collecting a user’s location is a powerful way to personalize interactions, offer region-specific services, and streamline experiences based on geography. In app.chitchatbot.ai, it’s easy to request and store a user’s location data—especially on channels like Facebook Messenger and WhatsApp, where native location sharing is supported.
This guide will walk you through how to request a user’s location, store it properly, and use it effectively in your flows.
🔄 Overview
ChitChatBot provides built-in support for gathering user location data and storing it in system fields. These fields can be used in actions, conditions, or external integrations like Google Sheets, CRMs, or Maps.
System Fields Used:
{{last_latitude}}
: The user’s most recently shared latitude{{last_longitude}}
: The user’s most recently shared longitude
📌 Step-by-Step: Requesting a User’s Location
✅ 1. Use the “Get User Data” Block
- Add the Get User Data block to your flow.
- Select the Location input type. This will display a native button for the user to share their location.
- Assign it to a Custom Field (e.g., shared_location_custom) to store the full location object (including lat/lng).

đź’ˇ The location will be automatically saved to your selected custom field, while
{{last_latitude}}
and{{last_longitude}}
are updated system-wide.

🌍 2. Use Location in Actions or Links
You can use the user’s coordinates in dynamic content, links, or conditions.
Example: Open location in Google Maps
rubyCopyEdithttps://www.google.com/maps/search/?api=1&query={{last_latitude}},{{last_longitude}}
This URL will open a map centered on the user’s most recently shared location.
đź§ Best Practices
- Always explain why you’re requesting the user’s location (e.g., “We need your location to find nearby stores”).
- Use fallback options if the user declines to share their location.
- Combine location data with conditions or tags to trigger personalized flows (e.g., city-specific promotions).
⚠️ Notes & Limitations
- Location sharing is only supported on certain channels, such as Messenger and WhatsApp.
- Some messaging platforms may not support native location inputs.
- The
{{last_latitude}}
and{{last_longitude}}
fields reflect only the most recent location shared by the user.
🚀 Example Use Cases
- Send the user directions to your nearest store.
- Trigger location-based notifications.
- Log user visits for regional sales tracking.
- Offer services based on proximity (e.g., delivery availability).