<commit_before>node-woopra ![Travis CI](https://travis-ci.org/Woopra/node-woopra.svg?branch=master)
===========

nodejs library for Woopra



## Installation

```
$ npm install woopra
```


## Usage

```javascript
var Woopra = require('woopra');
 
// Replace projectKey with your project key (generally your website name)
// `options` is an object, currently the only option supported is ssl: <true|false> (default: true)
var woopra = new Woopra('projectKey', options);
```

You can configure the tracker after initialization by calling `config(properties)`

```javascript
woopra.config({
    ssl: true
});
```

You *must* identify your users before tracking. Use the `identify(uid, properties)` method to attach a unique ID (we highly recommend using e-mails to get the most out of AppConnect), as well as other visitor properties.

Your custom visitor data will not be pushed until you send your first custom event. In order to push your identify without sending a custom event, use the `push` method.

```javascript
woopra.identify('<EMAIL>', {
    visitorProperty: 'property'
}).push();
```

To send a custom event, use `track(eventName, properties)`

```javascript
woopra.track('eventName', {
    eventProperty: 'property'
});
```

## Methods

## .config(options)
Sets some configuration options.

* `options` - object with the following available keys:

 key    | type   | description
 ------ | ------ | -----------
ssl | boolean | Use SSL for tracking requests.  SSL is not supported for Basic accounts.  (default: true)

## .client(options)
Sets some client configuration values.  These values are similar to custom visitor properties, but handled by Woopra in a different way.

* `options` - object with the following keys:<commit_msg>add callback to documentation<commit_after>node-woopra ![Travis CI](https://travis-ci.org/Woopra/node-woopra.svg?branch=master)
===========

nodejs library for Woopra



## Installation

```
$ npm install woopra
```


## Usage

```javascript
var Woopra = require('woopra');
 
// Replace projectKey with your project key (generally your website name)
// `options` is an object, currently the only option supported is ssl: <true|false> (default: true)
var woopra = new Woopra('projectKey', options);
```

You can configure the tracker after initialization by calling `config(properties)`

```javascript
woopra.config({
    ssl: true
});
```

You *must* identify your users before tracking. Use the `identify(uid, properties)` method to attach a unique ID (we highly recommend using e-mails to get the most out of AppConnect), as well as other visitor properties.

Your custom visitor data will not be pushed until you send your first custom event. In order to push your identify without sending a custom event, use the `push` method.

```javascript
woopra.identify('<EMAIL>', {
    visitorProperty: 'property'
}).push();
```

To send a custom event, use `track(eventName, properties)`

```javascript
woopra.track('eventName', {
    eventProperty: 'property'
});
```

Track event accepts an optional callback with error and HTTP response code parameters

```javascript
woopra.track('eventName', {
    eventProperty: 'property'
}, function(err, responseCode) {
	if(err) throw err;
	console.log(responseCode); //200 if OK
});
```

## Methods

## .config(options)
Sets some configuration options.

* `options` - object with the following available keys:

 key    | type   | description
 ------ | ------ | -----------
ssl | boolean | Use SSL for tracking requests.  SSL is not supported for Basic accounts.  (default: true)

## .client(options)
Sets some client configuration values.  These values are similar to custom visitor properties, but handled by Woopra in a different way.

* `options` - object with the following keys:
{'fraction_non_alphanumeric': 0.1250996015936255, 'fraction_numerical': 0.0007968127490039841, 'mean_word_length': 4.281907433380084, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '390276', 'n_tokens_mistral': 1090, 'n_tokens_neox': 1037, 'n_words': 430}