• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Bounteous-Inc/youtube-google-analytics: YouTube Google Analytics Embed Tracking

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

Bounteous-Inc/youtube-google-analytics

开源软件地址(OpenSource Url):

https://github.com/Bounteous-Inc/youtube-google-analytics

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

YouTube Google Analytics & GTM Plugin

As of 9/12/17, Google Tag Manager offers native support for tracking YouTube videos (including proper titles!). If you're looking to use GTM to track YouTube videos, we'd recommend using their native integration over our script.

This is a plug-and-play tracking solution for tracking user interaction with YouTube videos in Google Analytics. It will detect if GTM, Universal Analytics, or Classic Analytics is installed on the page, in that order, and use the first syntax it matches unless configured otherwise. It include support for delivering hits directly to Universal or Classic Google Analytics, or for pushing Data Layer events to be used by Google Tag Manager.

Once installed, the plugin will fire events with the following settings:

  • Event Category: Videos
  • Event Action: <Action, e.g. Play, Pause>
  • Event Label: <URL of the video>

By default, the plugin will track Play, Pause, Watch to End, and 10%, 25%, 50%, 75% , and 90% viewed events. The plugin can be configured to track whatever percentages are desired and/or not track Play, Pause, or Watch to End events.

The plugin will automatically bind to all videos on the page on DOMContentLoaded (window.load on IE8). The plugin will also bind to videos added inserted dynamically after DOMContentLoaded, as long as the following parameters are present in the src attribute of the iframe, e.g.:

<iframe src="https://www.youtube.com/embed/M7lc1UVf-VE?enablejsapi=1&origin=http%3A%2F%2Fwww.example.com"></iframe>    

Installation & Documentation

For installation instructions and complete documentation, visit http://www.lunametrics.com/labs/recipes/youtube-tracking/#documentation.

License

Licensed under the MIT License. For a complete copy of the license, please refer to the LICENSE.md file included with this repository.

Acknowledgements

Created by the honest folks at LunaMetrics, a digital marketing & Google Analytics consultancy. For questions, please drop us a line here or on our blog.

Written by Dan Wilkerson. Versions 1 - 6 written by Sayf Sharif.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap