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 of your app being 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.

Default user authentication

Default user authentication

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

Get app state with Ecwid JS SDK

  var storeData = EcwidApp.getPayload();
  var storeId = storeData.store_id;
  var accessToken = storeData.access_token;
  var language = storeData.lang;

  if (storeData.public_token !== undefined){
    var publicToken = storeData.public_token;

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

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 on the right.

Learn more about Default User Authentication

Enhanced security user authentication

Enhanced security user authentication


Get app state from GET parameter

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

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 on the right.

Learn more about Enhanced Security User Authentication

We use cookies and similar technologies to remember your preferences, measure effectiveness of our campaigns, and analyze depersonalized data to improve performance of our site. By choosing «Accept», you consent to the use of cookies.