eea / volto-matomo

Matomo integration for Volto
MIT License
3 stars 1 forks source link

Added the pushInstruction() function #16

Closed bipoza closed 2 years ago

bipoza commented 2 years ago

We have added the pushInstruction('key', ...args) function in the utils.js file, as it was the only one missing, to set custom settings to the Matomo instance.

This function can be used to pass additional features to Matomo.

The signature of pushInstruction is in the base code of matomo-tracker and allows passing arbitrary number of arguments.

import { pushInstruction } from '@eeacms/volto-matomo/utils';

// Example with multiple parameters
pushInstruction('setCustomDimension', 1, 'Hello world!');

// Example with one parameter
pushInstruction('setUserId', 'user_id');