Add tracking code to SharePoint

Does anyone know where in SharePoint 2013, could we add the tracker code, so that it appears on all pages? I have tried adding it into the v4.master file, however it still does not appear.

Thanks!

Hi there,

Please check the solution offered here: SharePoint Analytics - Analytics Platform - Piwik