Socket
Socket
Sign inDemoInstall

tvjs-google-analytics

Package Overview
Dependencies
0
Maintainers
14
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tvjs-google-analytics

This library provides Google Analytics support for Apple's tvOS TVMLKit JavaScript runtime. It uses the Google Analytics Measurement Protocol to provide a mobile SDK like API to track analytics events and screenviews within a tvOS Client/Server applicatio


Version published
Weekly downloads
1
Maintainers
14
Install size
9.96 kB
Created
Weekly downloads
 

Readme

Source

ES6 Google Analytics for Apple's tvOS TVMLKit JS Runtime

This library provides Google Analytics support for Apple's tvOS TVMLKit JavaScript runtime. It uses the Google Analytics Measurement Protocol to provide a mobile SDK like API to track analytics events and screenviews within the tvOS Client/Server application.

Example

First, initialize the library.

let ga = new GoogleAnalytics("YOUR_TRACKING_ID", "YOUR_APP_NAME");

Then, in your TVML documents onload handler:

<document onload="ga.screenview('YOUR_SCREEN_NAME');">
    ...
</document>

And, in your event handlers:

function mySelectHandler(event) {
    ga.event("YOUR_CATEGORY", "YOUR_ACTION"); 
}

Contributions

Contributions to support testing and additional event types are welcome.

Credits

Heavily inspired by Doug Richardson's prior art. https://github.com/drichardson/tvjs_google_analytics

Keywords

FAQs

Last updated on 18 Jul 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc