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

angulartics/angulartics-google-analytics: Google Analytics plugin for Angulartic ...

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

开源软件名称(OpenSource Name):

angulartics/angulartics-google-analytics

开源软件地址(OpenSource Url):

https://github.com/angulartics/angulartics-google-analytics

开源编程语言(OpenSource Language):

JavaScript 84.1%

开源软件介绍(OpenSource Introduction):

angulartics-google-analytics

NPM version NPM downloads Bower version Dependencies status MIT license Join the Slack chat Build Status

Google Analytics plugin for Angulartics.

Install

First make sure you've read installation and setup instructions for Angulartics.

Then you can install this package either with npm or with bower.

npm

npm install angulartics-google-analytics

Then add angulartics.google.analytics as a dependency for your app:

require('angulartics')

angular.module('myApp', [
  'angulartics',
  require('angulartics-google-analytics')
]);

Please note that core Angulartics doesn't export the name yet, but it will once we move it into the new organization.

bower

bower install angulartics-google-analytics

Add the <script> to your index.html:

<script src="/bower_components/angulartics-google-analytics/dist/angulartics-ga.min.js"></script>

Then add angulartics.google.analytics as a dependency for your app:

angular.module('myApp', [
  'angulartics',
  'angulartics.google.analytics'
]);

Changes in the Google Analytics snippet

The snippet code provided by Google Analytics does an automatic pageview hit, but this is already done by Angulartics (unless you disable it) so make sure to delete the tracking line:

      ...
      ga('create', 'UA-XXXXXXXX-X', 'none'); // 'none' while you are working on localhost
      ga('send', 'pageview');  // DELETE THIS LINE!
    </script>

Done. Open your app, browse across the different routes and check the realtime GA dashboard to see the hits.

Documentation

Documentation is available on the Angulartics site.

Settings

Module settings are done via the $analyticsProvider.settings.ga property. The following are GA-specific properties:

  • transport (Default: undefined) - sets the transport property for the ga function call. See the GA Transport Documentation for more information how to properly set this value. This should be a string.

Development

npm run build

License

MIT




鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
google/google.github.io发布时间:2022-06-11
下一篇:
bradtraversy/storybooks: Node.js app with Google OAuth发布时间:2022-06-11
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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