webpagelogger
v1.2.2
Published
NPM module for your websites what logs the visit of webpages to your API logger. It sends per POST all possible info what can be gathered from JavaScript including the unique JavaScript fingerprint to your API. The content data is sent asynchronous via PO
Maintainers
Readme
Webpagelogger
An NPM module for your websites that logs webpage visits to your API logger. It asynchronously sends a JSON payload via POST, containing all discernible JavaScript data, including a unique JavaScript fingerprint, to your API upon each visit.
Demo: https://webpagelogger.myridia.com
Usage:
Add a script import tag to your project:
<script src="node_modules/webpagelogger/dist/webpagelogger.js"></script>Add the below to your code declaration:
example without your page:
window.onload = async function () {
let wpl = new Webpagelogger({
"log_api": "http://couchdb.foo.com/logger", // required
"log_data": "json", // json(default) or x-www-form-urlencoded
"log_method": "POST" // POST(default) or PUT(not supported yet)
});
await wpl.logit();
};
example with your page filter:
window.onload = async function () {
let wpl = new Webpagelogger({
"log_api": "http://couchdb.foo.com/logger", // required
"log_data": "json", // json(default) or x-www-form-urlencoded
"log_method": "POST" // POST(default) or PUT(not supported yet)
"page": "example.com/category/page/
});
await wpl.logit();
};
Webpagelogger
GPL licenses A module for Webpagelogger
module.exports#post_json(url, _data) ⏏
Kind: Exported function
| Param | Type | Description | | --- | --- | --- | | url | str | url | | _data | object | data |
module.exports#post_x_www_form_urlencoded(url, doc) ⏏
Kind: Exported function
| Param | Type | Description | | --- | --- | --- | | url | str | url | | doc | object | doc |
module.exports#pad(number) ⇒ str ⏏
Kind: Exported function
Returns: str - - number
| Param | Type | Description | | --- | --- | --- | | number | str | number |
module.exports#help() ⏏
Kind: Exported function
module.exports#logit() ⏏
Kind: Exported function
