The CustomTrackerJs plugin lets the super users or other plugins add custom code to the Matomo (Piwik) Javascript Tracker.

Download for Matomo On-Premise This plugin is not available for Matomo for WordPress

Please share