Git Product home page Git Product logo

marzipan's Introduction

Marzipan

Marzipan is a client side tool for psuedo-de-anonymizing anonymous user pageview activity. It establishes an RFC4122-compliant UUID for each visitor and pings the server with the URL and UUID on each pageview.

Usage

User activity tracking requires work on both the client and server. Currently Marzipan only provides a solution for the client side. This means that what happens on the server is up to you. You can write something with Node, PHP, Sinatra, etc that fields the data and dumps into a database. Or you can just serve up the beacon image and parse over server logs.

A future version will include an optional server side component as well.

Client side config

The client side implementation has one required setting:

  • data-marzipan-ping: Ping URI

Optionally you can specify an Id for the tracked site:

  • data-marzipan-site: Site identifier

You also have to specify the location of the Marzipan script. :)

Asynchronous implementation (Recommended)

  <script>
    (function() {
      var t = document.createElement('script'),
        s = document.getElementsByTagName('script')[0];
      t.async = true;
      t.id = 'marzipan';
      t.setAttribute('data-marzipan-site', '123');
      t.setAttribute('data-marzipan-ping', '/ping.gif');
      t.src = 'marzipan.js';
      s.parentNode.insertBefore(t, s);
    })();
  </script>

Synchronous implementation

  <script src="marzipan.js" id="marzipan" data-marzipan-site="123" data-marzipan-ping="/ping.gif"></script>

Running Tests

I'm using Jasmine for tests. Coverage is not complete yet but if you want to run what's there make sure to run on a local server. (Reading/writing cookies doesn't work for local files.)

Contact

Changelog

0.2 (4/27/12): Rewrite. Removed server side component. Removed CoffeeScript. Added Jasmine tests.

0.1 (7/29/11): Initial release.

License

Licensed under the MIT and GPL licenses.

marzipan's People

Contributors

robflaherty avatar

Watchers

 avatar  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.