0.2.1 • Published 20 days ago

bitandblack-matomo-tracking v0.2.1

Weekly downloads
37
License
MIT
Repository
bitbucket
Last release
20 days ago

npm version

Bit&Black Matomo Tracking

Allows including the Matomo Tracking or the Matomo Tag Manager with JavaScript.

Installation

This library is made for the use with Node. Add it to your project by running $ npm install bitandblack-matomo-tracking. You can of course also use an alternative to NPM.

Usage

Matomo Tracker

Import the Matomo Tracker and initialize it 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:

  1. The page id. This one is required.
  2. The URL of your Matomo instance. This one is also required.
  3. Tracking options. These are optional.

Note: You don't need to add piwik.php or matomo.php in the url.

Matomo Tag Manager

Import the Matomo Tag Manager and initialize it like that:

import { MatomoTagManager } from "bitandblack-matomo-tracking";

const matomoTagManager = new MatomoTagManager(
    "container_Yolo25", 
    "https://www.yoursite.com/matomo"
);

The parameters are:

  1. The container id. This one is required.
  2. The URL of your Matomo instance. This one is also required.
  3. Tracking options. These are optional.

Help

If you have any questions feel free to contact us under hello@bitandblack.com.

Further information about Bit&Black can be found under www.bitandblack.com.

0.2.1

20 days ago

0.2.0

24 days ago

0.1.0

4 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago