Deep linking

Native apps in Ecwid Control Panel support deep linking, which means that they can receive information prior to being loaded and opened. This can provide your app with a new level of interactivity with a user by reacting to the context, sent to your app.

This functionality is achieved by passing a URL-encoded value – app_state to your application prior to loading and opening it for a user.

Sending app state

A typical native application URL looks like this:

In case your app is called using deep linking, that URL will also have a new parameter - app_state :

The app_state parameter value is a URL encoded string with a specific application state your app can understand and process.

Receiving app state

Receiving and processing the externally called app state depends on the type of user authentication you are using. See the details below.

  "store_id": 1003,
  "lang": "en",

Default user authentication


When using default user authentication, the app state will be delivered through the Ecwid JavaScript SDK in the EcwidApp.getPayload() method. Once it's called, you can save the user details and app state into your client-side variables. See example:

var storeData = EcwidApp.getPayload();

  if (storeData.app_state !== undefined){
    var appState = storeData.app_state;

Learn more about Default User Authentication

Enhanced security user authentication


When using enhanced security user authentication, the app state will be delivered as a GET parameter app_state of your iframe URL alongside the standard parameters. You can retrieve it just like any other value of a GET parameter on a server-side and then save and use it in your app code. See example:


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

Learn more about Authentication in native apps