{"id":20764171,"url":"https://github.com/mickey/videojs-ga","last_synced_at":"2025-05-09T00:08:58.636Z","repository":{"id":10490369,"uuid":"12671209","full_name":"mickey/videojs-ga","owner":"mickey","description":"Google Analytics plugin for video.js","archived":false,"fork":false,"pushed_at":"2017-05-25T11:35:51.000Z","size":269,"stargazers_count":138,"open_issues_count":23,"forks_count":106,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-09T00:08:51.016Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mickey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-07T20:40:09.000Z","updated_at":"2024-04-28T09:42:20.000Z","dependencies_parsed_at":"2022-07-30T18:47:59.520Z","dependency_job_id":null,"html_url":"https://github.com/mickey/videojs-ga","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickey%2Fvideojs-ga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickey%2Fvideojs-ga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickey%2Fvideojs-ga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mickey%2Fvideojs-ga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mickey","download_url":"https://codeload.github.com/mickey/videojs-ga/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253166521,"owners_count":21864482,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T10:49:02.795Z","updated_at":"2025-05-09T00:08:58.597Z","avatar_url":"https://github.com/mickey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# videojs-ga\n\nLOOKING FOR A MAINTAINER: [I am looking for a maintainer for this project](https://github.com/mickey/videojs-ga/issues/30)\n\nGoogle Analytics plugin for video.js\n\n## Getting Started\nDownload [videojs](http://www.videojs.com/) and [videojs.ga](https://github.com/mickey/videojs-ga)\n\nIn your web page:\n```html\n\u003cvideo id=\"video\" src=\"movie.mp4\" controls\u003e\u003c/video\u003e\n\u003cscript src=\"video.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"dist/videojs.ga.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nvideojs('video', {}, function() {\n  this.ga(); // \"load the plugin, by defaults tracks everything!!\"\n});\n\u003c/script\u003e\n```\n\n_Please note that the Google Analytics script must be loaded before the ga plugin_\n\n## Options\n\nYou can provide options to the plugin either by passing them in the javascript or in the html.\n\n```javascript\nplayer.ga({\n  'eventsToTrack': ['fullscreen', 'resize'],\n  'debug': true\n});\n```\n\n```html\n\u003cvideo id=\"video\" src=\"movie.mp4\" controls data-setup='{\"ga\": {\"eventsToTrack\": [\"error\"]}}'\u003e\u003c/video\u003e\n```\n\nThe plugin will take in priority options provided in the javascript, followed by the ones provided in html and finally the defaults.\n\nThe following options are supported:\n\n####eventCategory\n\nThis is the ```category``` sent to GA. If you don't know what it is please check [GA's doc](https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide)\n**default:** ```'Video'```\n\n\n####eventLabel\n\nThis is the ```label``` sent to GA. If you don't know what it is please check [GA's doc](https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide)\n**default:** basename of the video path so if the path is ```http://s3.amazonaws.com/pouet.mp4``` the label would be ```pouet```\n\n####eventsToTrack\n\nThe events you want to track. Most of this events are videojs events. Some of them might reflects my needs.\nI'm open to add some more if you care to provide a good use case or a pull request.\n**default:** every events\n  ```[ 'loaded', 'percentsPlayed', 'start', 'end', 'seek', 'play', 'pause', 'resize', 'volumeChange', 'error', 'fullscreen']```\n\nMost of the events are selft explanatory, here's the ones that may need more details:\n\n- ```percentsPlayed```: will send an event every X percents. X being defined by the option ```percentsPlayedInterval```.\n\n####percentsPlayedInterval\n\nThis options goes with the ```percentsPlayed``` event. Every ```percentsPlayedInterval``` percents an event will be sent to GA.\n**default:** 10\n\n####debug\n\nIf set to false, console logs will be ommited\n**default:** ```false```\n\n#### ga.js and analytics.js\n\nThis plugin supports the ga.js and the newer analytics.js Google Analytics libraries. It autodetects the library you use.\n\n## See information in google\nTo view the data on Google, access your account in analytics, in left panel click in Behavior \u003e Events \u003e Top Events.\n\n## TODO\n\n- [x] track the engine used (html5/flash) along with the source (ogg, mp4, ...)\n- [ ] track the time to download the video\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickey%2Fvideojs-ga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmickey%2Fvideojs-ga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmickey%2Fvideojs-ga/lists"}