# Getting the User's Location

*Skill Level: Intermediate*

## Before You Begin

* Ensure you have generated your [Google API Key](https://help.adalo.com/database/location/getting-your-google-api-key)
* Know about [Magic Text](https://help.adalo.com/component-basics/inserting-dynamic-text)
* You will need a paid Adalo plan to use this feature.
* Note that each time your app requests user location, your Google plan may be charged.

## &#x20;Walkthrough

{% tabs %}
{% tab title="Simple" %}
{% hint style="info" %}
**NOTE:** A user's location is not continuously updated on the backend. The device location only updates whenever they take an action (create, update, etc.) that uses their location. Thus, a map marker is not able to be "tracked" like you might see with Uber or Doordash.
{% endhint %}

### Requesting Permission

**1.)** Before you can start access a user's location, the app must first ask for their permission to do so. You can have the app request permission manually by adding a Click Action to any component, hovering **Location**, then clicking **Request Permission.** It's usually best to have this action either on screen load or when the user first tries to access location or map features of your app.

{% hint style="info" %}
**HINT:** If you forget to set this action up or decide not to, Adalo will ask the user automatically the first time their location is requested by the app.
{% endhint %}

### Accessing User Location

You can access the user's location through Magic Text in two different ways:

**1.)** Selecting the **Current Device Location** as with the Location Input component, form components, and other areas where you need to fill in a Location property specifically.

![Selecting the Current Device Location as the default location for a Location Input Component](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2F3EGSaySzeakna9BkmDDc%2FScreen%20Shot%202022-05-02%20at%205.50.40%20PM.png?alt=media\&token=20afebf9-06e6-4766-8e18-4cbc5de5d8d7)

![Selecting the Current Device Location as part of a Create Action to set the Location property (Destination) of a new Trip.](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2Fm9pfrn9P5Bt70oeSVJFC%2FScreen%20Shot%202022-05-02%20at%205.51.10%20PM.png?alt=media\&token=02aa924e-412b-4574-a126-8cb4aaa7fca6)

**2.)** Selecting the **Current Device Location's >** individual data properties such as full address, zip code, latitude, longitude, etc. by hovering over the **Current Device Location >** itself and choosing the piece of data you need. This is for filling in fields that are not location property types.

![Setting a map's marker address to the Current Device Location's Full Address](https://3467607506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LhGHkPsv15svPIU5I7C%2Fuploads%2Fpzz2yKoh5P9YcScVuY9L%2FScreen%20Shot%202022-05-02%20at%205.59.42%20PM.png?alt=media\&token=4dcdc7c9-2adf-464a-a278-c1425de6ed3f)
{% endtab %}
{% endtabs %}

## Learn More

* A user's location is not continuously updated. User device location is only pulled when they take an action in the app that uses their location (create, update, etc.). Thus, the user is not able to be tracked the way you might track your Uber driver or Doordash delivery.
* Getting device location works on Android, iOS, PWAs, and desktop web apps.
* Check out our [course in the App Academy](https://appacademy.adalo.com/course/geolocation-uber-airbnb) about using Location.

## Help

If you need additional help with this article, you can always ask in our [community forum](https://forum.adalo.com/)! Be sure to paste the link to this article in your post as well!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.adalo.com/database/location/getting-the-users-location.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
