Socket
Socket
Sign inDemoInstall

meanie-angular-analytics

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    meanie-angular-analytics

An Angular wrapper service for Google Analytics


Version published
Maintainers
1
Created

Readme

Source

meanie-angular-analytics

npm version node dependencies github issues codacy

An Angular wrapper service for Google Analytics

Meanie

Installation

You can install this package using npm:

npm install meanie-angular-analytics --save

Include the script node_modules/meanie-angular-analytics/release/meanie-angular-analytics.js in your build process, or add it via a <script> tag to your index.html:

<script src="node_modules/meanie-angular-analytics/release/meanie-angular-analytics.js"></script>

Add Analytics.Service as a dependency for your app.

Usage

angular.module('App', [
  'Analytics.Service'
])
.config(function($analyticsProvider, Config) {
  $analyticsProvider.setEnabled(Config.ANALYTICS_ENABLED && Config.ANALYTICS_TRACKING_ID);
})
.run(function($rootScope, $analytics, Config) {

  //Check if enabled
  if ($analytics.isEnabled()) {

    //Create site wide tracker
    $analytics.create(Config.ANALYTICS_TRACKING_ID);

    //On state changes, track page views
    $rootScope.$on('$stateChangeSuccess', function() {
      $analytics.track.pageview();
    });
  }
});

Issues & feature requests

Please report any bugs, issues, suggestions and feature requests in the meanie-angular-analytics issue tracker.

Contributing

Pull requests are welcome! If you would like to contribute to Meanie, please check out the Meanie contributing guidelines.

Credits

  • Meanie logo designed by Quan-Lin Sim

License

(MIT License)

Copyright 2016-2017, Adam Reis

Keywords

FAQs

Last updated on 01 May 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc