Add the Tracking to your main.js
:
Add Tracking.
import tracker from 'massiveart-tracking';
Add the specific tracking type. Valid types are tracker-googler
and tracker-matomo
.
import MatomoTracker from 'massiveart-tracking/tracker-matomo';
Finally, Add the type to the tracker instance.
tracker.add(new MatomoTracker());
You can also add multiple types, the data will be sent to all types simultaneously.
Use the predefined functions:
For Datalayer pushes: tracker.dataLayerPush(data);
For sending normal events: tracker.sendEvent(data);
In your navigation.js:
Import tracker to use the functions:
import tracker from 'massiveart-tracking';
Use the functions:
tracker.sendEvent('Navigation', 'click', 'Parent page | child page');
Or a correctly formatted Datalayer object with tracker.dataLayerPush(data);
This package automatically handles the cookie constent logic of matomo in combination with Cookiehub. All you need to do is correctly import the Cookiehub Script and Matomo script.
- IMPORTANT: Add
_paq.push(['requireCookieConsent']);
to your Matomo script for this to work.
For more information, see the Matomo documentation for consent.
This package automatically handles the cookie constent logic of the Facebook pixel (in consent mode) in combination with Cookiehub. All you need to do is correctly import the Cookiehub Script and Facebook script.
- IMPORTANT: Add
fbq('consent', 'revoke');
to your Facebook script for this to work.
For more information, see the Cookiehub guide on how to implement facebook in consent mode.
If your project uses any other scripts that need to be blocked, until consent is given by Cookiehub, add the data-consent="analytics"
data attribute to the script.
For more information, see the Cookiehub guide to handle scripts and iframes.