Top

Integrate Matomo aka Piwik on-premise Analytics

Prev Next

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.

  2. Create or add scripts in Advanced Customization to capture various kinds of analytic data. For more information, contact support@whatfix.com.

  3. Use the following code to initialize Matomo with Whatfix:

 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:

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.

Privacy Policy | Whatfix Glossary | Whatfix Platform Status
Copyright © 2024 WHATFIX TM. All rights reserved.