0.1.0 • Published 4 years ago
bitandblack-matomo-tracking v0.1.0
Matomo Tracking
Allows to include the Matomo Tracking by JS.
Installation
This library is made for the use with Node. Add it to your project by running $ npm install bitandblack-matomo-tracking
or $ yarn add bitandblack-matomo-tracking
.
Usage
Import the library and initialize like that:
import { MatomoTracking } from "bitandblack-matomo-tracking";
const matomoTracking = new MatomoTracking(
99,
"https://www.yoursite.com/matomo",
{
trackPageView: true,
enableLinkTracking: true
}
);
The parameters are:
- The page id. This one is required.
- The URL of your Matomo instance. This one is also required.
- Tracking options. These are optional.
Note: You don't need to add piwik.php
or matomo.php
in the url.
Help
If you have any questions feel free to contact us under hello@bitandblack.com
.