GithubHelp home page GithubHelp logo

mindis / piwik-tracker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from matomo-org/matomo-nodejs-tracker

0.0 2.0 0.0 188 KB

A Node.js wrapper for the Piwik tracking HTTP API

License: MIT License

JavaScript 100.00%

piwik-tracker's Introduction

Piwik Tracker NPM version Build Status

A wrapper for the Piwik Tracking HTTP API

Usage

First, install piwik-tracker as a dependency:

npm install --save piwik-tracker

Then, use it in your project:

var PiwikTracker = require('piwik-tracker');

// Initialize with your site ID and Piwik URL
var piwik = new PiwikTracker(1, 'http://mywebsite.com/piwik.php');

// Optional: Respond to tracking errors
piwik.on('error', function(err) {
  console.log('error tracking request: ', err)
})

// Track a request URL:
// Either as a simple string …
piwik.track('http://example.com/track/this/url');

// … or provide further options:
piwik.track({
  url: 'http://example.com/track/this/url',
  action_name: 'This will be shown in your dashboard',
  ua: 'Node.js v0.10.24',
  cvar: JSON.stringify({
    '1': ['custom variable name', 'custom variable value']
  })
});

That's it. For a complete list of options, see Piwik's Tracking HTTP API Reference.

License

MIT License

piwik-tracker's People

Contributors

fhemberger avatar

Watchers

Mindaugas Zickus 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.