--- title: "Integrate Matomo aka Piwik on-premise Analytics" slug: "integrating-matomo-aka-piwik-on-premise-analytics" updated: 2026-08-12T05:47:08Z published: 2026-08-12T05:47:08Z canonical: "support.whatfix.com/integrating-matomo-aka-piwik-on-premise-analytics" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://support.whatfix.com/llms.txt > Use this file to discover all available pages before exploring further. # Integrate Matomo aka Piwik on-premise Analytics You can integrate Matomo analytics to analyze how your content is performing using Whatfix APIs. The following are some of the information that you can track: - How many users are completing a Flow? - How many are closing the Flow before completing it, and if so, at which step? - What users are searching for content in Self Help? --- Use the following steps to configure Matomo on-Premise: 1. Install Matomo on-Premise using instructions from [Install and Setup Matomo](https://matomo.org/docs/installation/#mysql-database-setup). 2. Create or add scripts in [Advanced Customization](/studio/docs/advanced-configuration) to capture various kinds of analytic data. For more information, contact [support@whatfix.com](mailto:support@whatfix.com?Subject=Information%20on%20Advance%20Customization&Body=Hello%20Team%2C%0A%0AKindly%20provide%20more%20information%20on%20Advance%20Customization.%0A%0AMore%20queries%3A%0A%0AThanks%20and%20regards.). 3. Use the following code to initialize Matomo with Whatfix: ```plaintext var _paq = window._paq || [];  _paq.push(['trackPageView']);  _paq.push(['enableLinkTracking']);  (function() {    var u="//xx.xxx.xx.xx/matomo/";    _paq.push(['setTrackerUrl', u+'matomo.php']);    _paq.push(['setSiteId', '1']);    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];    g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);  })(); ``` your title goes here In the above script, replace xx.xxx.xx.xx with the respective IP address that you use for your Matomo account. your title goes here You can add scripts to capture specific information. For example, to capture the number of times a Flow is triggered, use the following script: ```plaintext window._wfx_settings.tracker = {       track:track, }; function track(event){ //Push data to matomo            _paq.push(['setCustomUrl',event.on_id]); _paq.push(['trackPageView']);    if(event.flow_id!=null)  {  //Push data to matomo  _paq.push(['setCustomVariable','1','flow_id',event.flow_id]); _paq.push([ function() { var customVariable = this.getCustomVariable(1); }]);  }    if(event.event_name != null && event.event_name == "trackSelfHelpClicked")    {      //Push data to matomo     _paq.push(['trackEvent', 'SelfHelp Clicked', event.event_name]);     } } ``` your title goes here To track the analytics for other criteria actions using scripts, contact [support@whatfix.com](mailto:support@whatfix.com?Subject=Track%20the%20analytics%20for%20other%20criteria%20actions%20using%20scripts&Body=Hello%20Team%2C%0A%0AKindly%20provide%20assistance%20to%20track%20the%20analytics%20for%20other%20criteria%20actions%20using%20scripts%0A%0AMore%20queries%3A%0A%0AThanks%20and%20regards.). ## Related - [Flows](/flows-1.md)