GithubHelp home page GithubHelp logo

hiro333 / backbone.analytics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aterris/backbone.analytics

0.0 2.0 0.0 129 KB

Simple Backbone and Google Analytics Integration

Home Page: http://andrewterris.com/backbone.analytics/

License: MIT License

backbone.analytics's Introduction

Backbone Analytics

A small object to manage the integration of google analytics into a backbone application. It is meant to be simple and implementation agnostic. Depends on Underscore.js and Backbone.js. For more detailed documentation see the docs

Example

 <script src="/js/underscore.js"></script>
 <script src="/js/backbone.js"></script>
 <script src="/js/backbone.analytics.js"></script>
 <script>
   window.App = window.App || {};
   window.App.ga = new Backbone.Analytics({code: 'UA-12345678-9'});
 </script>

Usage

This object is meant to be simple and flexible so you can use it however works best for your needs and implementation. I prefer to extend the object and use it to write methods that contain my specific analytics integrations. However, you can also use it as is.

Option Defaults

  • setAccount: true
  • initialPageview: true
  • trackNavigate: true
  • loadScript: true
  • debug: false

Syntactic Sugar

Backbone.Analytics provides a few convience methods that wrap around common google analytics objects and interactions including queue, push, setAccount, trackPageview, trackEvent, trackSocial, and setCustomVar

Debug Mode

Enabling debug mode will include the debug version of the google analytics script instead of the standard script. This will log debug information to the console. Enable debug mode by passing debug: true

Extending Backbone.Analytics

Extending Backbone.Analytics can help you manage and maintain your domain specific analytics interactions in a single location.

backbone.analytics's People

Contributors

aterris avatar

Watchers

James Cloos avatar hiro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.