目录

adapt-googleanalytics

This is not an official Google product.

This is a simple Adapt extension that implements Google Analytics upon post render of pageView, which is triggered when a page’s view has rendered. Be sure to include the Analytics library and Autotrack in core > js > scriptLoader.js.

Example:

scripLoader.js:

function setupRequireJS() { requirejs.config({ map: { … }, paths: { … analytics: ‘https://www.google-analytics.com/analytics', autotrack: ‘libraries/autotrack’ }

Use Autotrack semantics in component-level .hbs files for tracking events such as mouseover and clicks.

Example:

<div class="graphic-inner component-inner" role="region" aria-label="{{_globals._components._graphic.ariaRegion}}" ga-on="mouseover" ga-event-category="Graphic Component" ga-event-action="Mouseover" ga-event-label="{{displayTitle}}">

Video tracking is already available through the MediaElement library. Add “universalgoogleanalytics” to “features” for a given media component. Example:

“features”: [ … “universalgoogleanalytics” ]

关于
52.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号