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

# Smart TV integration

> Integrate MoEngage Web SDK with LG webOS and Samsung Tizen smart TVs for analytics and messaging.

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](https://www.moengage.com/docs/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.](https://www.moengage.com/docs/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](https://www.moengage.com/docs/developer-guide/web-sdk/data-tracking)
* [On-site Messaging](https://www.moengage.com/docs/user-guide/campaigns-and-channels/on-site-message/create/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={null}
  <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>
