How can I customize sampling for page timing reports?
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:
- Open Piwik PRO.
- Navigate to Menu > Tag Manager.
- Click + Create new tag.
- Name the tag.
- Select Custom asynchronous tag template and click Save.
- Paste the following code:
- Click + Existing trigger.
- Pick the All page views trigger.
- Click Save.
- Click Publish.
<script> var _paq = _paq || ; _paq.push(['setTimingDataSamplingOnPageLoad', 10]); </script>
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.
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.