> ## Documentation Index
> Fetch the complete documentation index at: https://moengage-sdk-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Smart TV integration

The MoEngage Web SDK can track user data and events to enhance analytics and display onsite messages in **LG TVs (webOS)** and **Samsung Tizen OS TV**.

For a complete technical reference, check out our [Javascript Documentation](/developer-guide/web-sdk/web-sdk-integration/basic-integration/web-sdk-integration) or our sample apps for [LG TV](https://github.com/moengage/webSDK-sample/tree/master/lg-web-os)  and [Samsung TV](https://github.com/moengage/webSDK-sample/tree/master/samsung-tizen-os/samsungTizenOs) to see the Web SDK running on a TV.

<Check>
  1. Do not add the serviceworker.js file, as Push Notification does not work here.
  2. Pass `disable_web_push: true` to the initialization config., so that the SDK does not initialize the Push Notification module. More details are available [here.](/developer-guide/web-sdk/web-push/configure-and-integrate-web-push#Rename-the-Service-worker-custom-filename)
  3. Pass `disableCookies: true` to disable the usage of any cookies
</Check>

## Supported Features

* [Data Tracking](/developer-guide/web-sdk/data-tracking)
* [On-site Messaging](https://help.moengage.com/hc/en-us/articles/25289365657620-Create-OSM-Campaign-for-TV)

## Integration

Since the TV apps does not have URL and the SDK requires to do a lot of stuff on changing page/screen, it needs to be notified that the page/screen has changed. So you have to call the helper function `Moengage.handle_page_change()` on changing the screen

## TV Remote Navigation in On-site Messaging (OSM)

We only support horizontal navigation in the template as of now. In the OSM campaign creation, when you select TV as the platform in Step-1, you will only be able to use the limited templates available. In those templates, only horizontal navigation can be used.

## Deeplinks in OSM Templates

Since the hyper link redirection cannot happen by default in TV as in browsers, there is a event being emitted from the template on clicking on any link and you can listen to that events and handle the redirection.

<CodeGroup>
  ```javascript JavaScript lines wrap theme={"theme":{"light":"github-light","dark":"github-dark"}}
  <script type="text/javascript">
  window.addEventListener('MOE_AUTOMATED_EVENTS', function (event) {
    if(event.detail) {
      if(event.detail.name === 'MOE_ONSITE_CLICKED') {
        console.log(event.detail.data);
        // {
        //   deeplink: 'https://google.com',
        //   label: 'Click Me',
        //   campaignName: 'Test Campaign'
        // }
      }
      if(event.detail.name === 'MOE_ONSITE_DISMISSED') {
        console.log(event.detail.data);
        // {
        //   label: 'Click Me',
        //   campaignName: 'Test Campaign'
        // }
      }
    }
  });
  </script>
  ```
</CodeGroup>

## Sample Code

We have created the following sample apps for reference.

1. [LG Web OS](https://github.com/moengage/webSDK-sample/tree/master/lg-web-os)
2. [Samsung Tizen OS](https://github.com/moengage/webSDK-sample/tree/master/samsung-tizen-os/samsungTizenOs)

<Info>
  The Web SDK supports the following TV OS versions:

  * LG webOS TV 5.0 and above
  * Samsung Tizen 4.0 and above
</Info>
