GithubHelp home page GithubHelp logo

ga-video-js's Introduction

ga-video-js

Google Analytics plugin for video.js

Event Actions

  • Play - block by adding key 'play' to ga.options.holdEvent with some truthy value.
  • Pause - block by adding key 'pause' to ga.options.holdEvent with some truthy value.
  • Finish - block by adding key 'ended' to ga.options.holdEvent with some truthy value.
  • Progress - block by adding key 'timeupdate' to ga.options.holdEvent with some truthy value.

Setup

Include the plugin after including the main video.js file:

<script type="text/javascript" src="/js/video-js/video.js"></script>
<script type="text/javascript" src="/js/video-js/ga.plugin.js"></script>

Minimal setup

_V_("{{video_element_id}}",{
  // other options and plugins here
  "ga": {}
});

Advanced setup

_V_("{{video_element_id}}",{
  // other options here
  "ga": {
    "category": "Video"
    ,"label": "WMOKWNXC"
    ,"queue": '_gaq'
    ,"logInterval": 15
    ,"volumeScale": 100
    ,"onlyLogOriginalSrc": true
    ,"debug": false
    ,"holdEvent": {"progress":true}
  }
});

Parameters

All parameters passed in the options.ga hash are optional

  • {{key}}:{{default_value}}
  • category:'Video' Category to use for Google Analytics (GA) Events.
  • label:player.currentSrc() Unique identifier to log under GA's Events' Label.
  • queue:'_gaq' String that refers to google analytics queue array in window scope.
  • logInterval:15 Interval (in seconds) on which to log 'Progress' events.
  • volumeScale:100 For volume change events (not currently active); factor to normalize volume (as volume is stored as a float between 0.0 and 1.0).
  • onlyLogOriginalSrc:true Will restrict logging to only apply to the original source of the video element in case the source is being changed (ads).
  • debug:false When set to true will send all log reqeusts to V.log, which should go to window.console.log.
  • holdEvent:{} Hash that will block events from being logged to GA.

ga-video-js's People

Contributors

mcountis avatar

Stargazers

Bill Ottman avatar Andy avatar tony felice avatar Dave Ackerman avatar  avatar

Watchers

 avatar  avatar

ga-video-js's Issues

What does this log?

Hey there.

This look like a cool plugin. What events does this log, and could you add those to the README? Going to give it a shot anyway, but figured others could benefit from seeing what it really does.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.