<commit_before>## Install

```ruby
  gem install keepify
```

## Usage

### Initialize Keepify

```ruby
  @keepify = Keepify::Tracker.new(YOUR_KEEPIFY_API_TOKEN)
```

### Tracking events

```ruby
  @keepify.trackEvent(event_type, user_id, options)
```
Where **event_type** is a string representing the type of the tracked event, for example : "page_view" or "item_purchase", **user_id** is a unique identifier of the tracked user such as the user's email.
and **options** is a hash that accepts the following keys:

  * **kphn** : hostname e.g. "http://mysite.com"
  * **kppt** : page title e.g. "homepage"
  * **kpr** : the referral url
  * **kppr** : the path of the current URL e.g. "/myitems/1"<commit_msg>Update documentation for usage to include the asynch<commit_after>## Install

```ruby
  gem install keepify
```

## Usage

### Initialize Keepify

```ruby
  @keepify = Keepify::Tracker.new(YOUR_KEEPIFY_API_TOKEN, asynch)
```
* **async** : Boolean

  *Default: false*

  Built in async feature that starts a thread to send the request. This solution may become inefficient if your application generates events at a high rate. in that case, consider using a more robust solution such as delegating the tracking to a background job using resque.

### Tracking events

```ruby
  @keepify.trackEvent(event_type, user_id, options)
```
Where **event_type** is a string representing the type of the tracked event, for example : "page_view" or "item_purchase", **user_id** is a unique identifier of the tracked user such as the user's email.
and **options** is a hash that accepts the following keys:

  * **kphn** : hostname e.g. "http://mysite.com"
  * **kppt** : page title e.g. "homepage"
  * **kpr** : the referral url
  * **kppr** : the path of the current URL e.g. "/myitems/1"
{'fraction_non_alphanumeric': 0.12885154061624648, 'fraction_numerical': 0.0011204481792717086, 'mean_word_length': 4.379518072289157, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3153043', 'n_tokens_mistral': 597, 'n_tokens_neox': 559, 'n_words': 219}