Customize your Piwik Data

For all analytics users, there comes a time after playing with the data and getting over the learning curve of a new web analytics tool that the generic reports that the web analytics tools have by default are just not enough for your business. You’re wanting to manipulate data within the web analytics tool itself rather than doing a lot of grunt work outside of the web analytics tool (using something like Excel).

Thankfully, for practically every web analytics tool out there, there’s an option for customization. For Piwik specifically, analysts have the option to create segments, reports, and custom variables.

Let’s go into detail how to do all three!

Piwik Segments

After logging into Piwik, select any of the five items in the main navigation (Dashboard, Visitors, Actions, Referrers, or Goals). Depending on what information from your website you want to look at (such as number of visitors on your website’s pages), select the appropriate main navigation tab.

From there, click the box underneath the main navigation that says “All Visits.” This box contains all the segments you have and will create for your Piwik data.

If you already have created segments, you’ll see a list of your previously made segments in the “All Visits” dropdown. Keep in mind that these segments are not final. You can always edit or delete them at any time by clicking the pencil icon to the right of the segment.

If it’s your first time creating a segment, go ahead and click “Add new segment.”

With the above screen, you’ll be able to create your segment by choosing from the list of statistics on the left and declaring if you’re including or excluding certain pieces of data from your analytics dashboard.

For instance, if you create a segment where you want to filter your data so that you only see LinkedIn referral traffic, you would choose “Referral URL” under “Referrers” in the left list of statistics. Then you would include two entries in your segment that contains and

Once you’ve adjusted your segment, click “Save & Apply.” In a few seconds, you’ll see your Piwik data filtered using your new segment. If you want to go back to seeing all of your Piwik data, change the segment back to “All visits (default).”

Piwik Reports

The next way you can customize your Piwik data is by creating custom email reports. The great thing about custom email reports is that you can apply any of your segments and choose any or all statistics in the report. Additionally, you’re able to show the data in the reports in tabular format, with graphics, or both. And the best thing is that you can get these reports sent to your email or mobile device weekly/monthly/etc. at any time you’d like.

To access Piwik reports, head over to “Email Reports.”

Once you’re in Email Reports, you can create or edit a report.

Select and fill in all the options you’d like in your custom email report.

Click “Create Report” and look for your automated report in your inbox or on your mobile phone. Now you’ve created a custom email report in Piwik!

Piwik Custom Variables

The last way you can customize your Piwik data is by creating custom variable. That means using JavaScript!

If you’re a bit terrified of JavaScript, don’t worry. Setting up a custom variable in Piwik is simple.

First, head over to Settings > Tracking Code.

Then scroll down until you find “JavaScript Tracking Code.” This is where you’ll insert your custom variables.

To create a custom variable for visits and pageviews, use the following (template) code:

setCustomVariable(index, name, value, scope)

where scope is “visit” for visits and “page” for pageviews.

To further explain this concept, let’s use an example of what a real custom variable would look like:

_paq.push([‘setCustomVariable’, 3, ‘UserType’, ‘Member’, ‘page’]);


The above code would track the user type as a member on the pageview, and this custom variable would be the third custom variable created (its index is 3).

Copy the above code into your JavaScript Tracking Code and you’re done!

If you still need help with custom variables, Piwik has an easy to read guide on implementing JavaScript for custom variables.

Explore Piwik’s Customization Options

Now that you know how to customize and filter your Piwik data, use this opportunity to change your reports to fit the needs of your company and analytics team.

Like this article? Comment below and share this article on social media!

Need web analytics consulting to improve your analytics setup? Call us at 877-694-2495 or email us at