How can I customize sampling for page timing reports?

Analytics new

By default, 5% of all tracked events store information about the page performance. It is possible to customize it by adding a custom tag in the Tag Manager.

To increase the sample to 10% for example, follow these steps:

  1. Open Piwik PRO.
  2. Navigate to Menu > Tag Manager.
  3. Click + Create new tag.
  4. Name the tag.
  5. Select Custom asynchronous tag template and click Save.
  6. Paste the following code:
  7. <script>
      var _paq = _paq || [];
      _paq.push(['setTimingDataSamplingOnPageLoad', 10]);

    In this code, you can change the number 10 to a different number to have a smaller or bigger sample. If you use 10 it means that 10% of the all tracked events will be measured to track the performance of pages.

  8. Click + Existing trigger.
  9. Pick the All page views trigger.
  10. Click Save.
  11. Click Publish.

If you increase the sample to a much greater value than 10%, it will increase the number of tracking requests significantly and may cause performance problems in the tracking.

Was this article helpful?

Be the first to rate this article.

Technical Support

If you have any questions, drop us a line at

We’re happy to help!