> For the complete documentation index, see [llms.txt](https://docs.customerglu.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.customerglu.com/schema/webview-callback-schema.md).

# Webview Callback Schema

### **Open Deeplink**

**Example use case**: Webview wants to redirect user to cart page on a button click.

```jsx
{
  "user_id":"xyz",
  "eventName": "OPEN_DEEPLINK",
  "data": {
    "deepLink": string,
    [key: string]: string
  }
}
```

### **Close**

**Example use case:** User wants to close the webview by clicking on close button.

```jsx
{
  "user_id":"xyz",
  "eventName": "CLOSE",
  "data": null
}
```

### **Share**

**Example use case:** User might want to use social share for referral or sharing reward the user won.

```jsx
{
  "user_id":"xyz",
  "eventName": "SHARE"
  "data": {
    "channelName": "WHATSAPP" | "OTHERS",
    "text": "string",
    "image": "string"
  }
}
```

### Invalid Campaign Id

**Example use case:** In case of providing an [invalid campaignId](/sdk/mobile-sdks.md#handling-invalid-campaign-id) in the open campaign method, the wallet opens up by default. The following event is also triggered and can be consumed to handle the case in a custom manner.

```json
{
  "user_id":"xyz",
  "eventName": "CG_INVALID_CAMPAIGN_ID"
  "data": {
    "campaignId":"xyz-abc-123"
    "message":"Invalid campaignId, opening Wallet"
   }
}
```

### Analytics

**Example use case:** Capture Webview interaction events like page loads, clicks directly on the app

```json
{
   "user_id":"xyz",
   "eventName":"ANALYTICS",
   "data":{
      "timestamp":"2022-07-11T09:16:48.917Z",
      "event_name":"xyz",
      "event_properties":{
         "lorem":"ipsum"
      }
   }
}
```

[Check all analytics events schema here](/schema/webview-callback-schema/analytics-event-schema.md)
