Giter VIP home page Giter VIP logo

web-analytics-client's Introduction

Note

⚠️ This project is no longer maintained.

Web Analytics Client Library

This library has the basic features of Google Analytics library or of any similar web analytics tool.

Tracking Code

The following tracking code should be included in each page you want to keep track of user interaction.

<script type="text/javascript">
  (function(a,s,i,m,o,v,x){a['LibAnalytics']=o;a[o]=a[o]||function(){
  (a[o].q=a[o].q||[]).push(arguments)},a[o].l=1*new Date();v=s.createElement(i),
  x=s.getElementsByTagName(i)[0];v.async=1;v.src=m;x.parentNode.insertBefore(v,x)})
  (window,document,'script','analytics.js','at');
  at('setAccount', '123456789');
  at('trackPageview');
</script>

Demo

See a demo here

Open the dev tools to see the trackPageview event data. The script tries to send data to http://localhost:3030/collect which should be the webhook endpoint exposed by data-collector service.

Currently the only event is the trackPageview, which sends a bunch of information including visited page, client device, platform and browser. The script generates a GUID for each client storing it in the cookies in order to make it recognize at each page visit keeping track of it and of actions performed by the user.

Project Setup

This project uses gulp as its build system.

  • Install gulp: $ npm install -g gulp
  1. Install dependencies: $ npm install
  2. Build: $ gulp build

License

MIT © 2017 alesmit

web-analytics-client's People

Contributors

alesmit avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

vrathod3010

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.