> For the complete documentation index, see [llms.txt](https://docs.ecwid.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ecwid.com/launch-apps/native-and-external-apps/build-user-settings-page-for-ecwid-admin/deep-linking.md).

# Deep linking

Apps in Ecwid admin can receive specific store information before loading through **deep linking**. When an app is opened from a specific page, Ecwid sends a URI-encoded page slug as an `app_state` query parameter. Use its value to adjust app flow depending on the page users came from.

Default **iframeUrl** example: `https://my.ecwid.com/store/1234567#app:name=my-cool-app&parent-menu=sales`

Example of the **iframeUrl** with **deep linking**: `https://my.ecwid.com/store/1234567/#app:name=my-cool-app&app_state=orderId%3A%2012`

With the `app_state`, you can redirect users to the page they came from with the [EcwidApp.OpenPage()](ref:native-app-js-sdk#ecwidappopenpagepage) method.

### Receive app state when accessing store data

Apps loading in Ecwid admin can receive the `app_state` before the [authentication process](/launch-apps/native-and-external-apps/access-store-data-from-the-app.md). When users open the app, you'll receive a request on your server:

`GET https://www.example.com/my-app-iframe-page?payload=353035362c226163636573735f746f6b656e223a22776d6&app_state=orderId%3A%2012&cache-killer=13532`

Check `app_state` in your authentication flow and save its value to a variable.

Code example:

```php
<?php

// URL Encoded App state passed to the app
  if (isset($_GET['app_state'])){
    $app_state = $_GET['app_state'];
  }
?>
```

Decoded payload example:

```json
{
  "store_id": 1003,
  "lang": "en",
  "access_token":"xxxxxxxxxxxxxxxx",
  "app_state":"orderId%3A%2012"
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://docs.ecwid.com/launch-apps/native-and-external-apps/build-user-settings-page-for-ecwid-admin/deep-linking.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.
