Skip to main content

Samsung and LG TV

Samsung (Tizen) and LG (webOS) TV apps are web apps. They run the same OptSens web script as a website, not the mobile SDK. The banner detects the TV and shows a large-screen, remote-controlled layout on its own.

For native Apple TV, Android TV or Fire TV, use the Mobile & TV SDK instead.

Add your TV app

Add your TV app the same way as a website. Click Add Domain, choose TV app, then pick Samsung (Tizen) or LG (webOS) and enter your app id. Your Domain ID is in the Integration step, and later on the dashboard Integration page.

Add the script

Add the snippet to your app's HTML, as the first script in <head>:

<script src="https://cdn.optsens.com/optsens.min.js/YOUR_DOMAIN_ID"></script>

Block trackers by tagging them

TV apps are not scanned, so OptSens does not know your third-party scripts in advance. Tag each one so it is blocked until the visitor consents to its category. Change the script type to text/plain and add the category:

<script type="text/plain" data-os-category="analytics"
src="https://vendor.example.com/sdk.js"></script>

Use the same attribute on an iframe, with the category on the element:

<iframe data-os-category="advertising" src="https://vendor.example.com/embed"></iframe>

Categories: functional, analytics, advertising, performance. Use commas for more than one. necessary scripts always run.

You can also block iframes from the dashboard Iframe rules page by adding their URL patterns, instead of tagging each one in your HTML. This needs iframe blocking enabled in Privacy settings and a plan that includes it.

After installing

Open your TV app. The banner shows on first launch and navigates with the remote. Tagged scripts and iframes load only after the visitor consents.