Using custom variables

Hi all,

we’ve just downloaded a copy of Piwik, since we’re interested in the fact that we can have direct access to the raw data in the database, which hasn’t been the case with other solutions that we’ve looked at.

We’re coming from Google Analytics, and appreciate the functionality that allows to add custom variables to the tracking code. After Googling a bit, we found some resources that discuss a similar feature in Piwik. However, we’re unable to discover any examples that show how this can be achieved.

So we’re currently stuck with three questions …

  • How should the JavaScript code look that adds the custom parameter?
  • Do we need to develop a plugin or anything else for Piwik to handle the custom data?
  • Should the database be prepared in any way, so Piwik can store the custom data?
Can anybody provide any insights in this matter? Any help is much appreciated!

Cheers, Shahways

please post your technical question on piwik-hackers mailing list (more info on

FYI, I will be working on putting ‘Visitor custom variable’ in Piwik in the next release. Keep an eye on the ticket: Custom Variables support: new JS API and new reports · Issue #1984 · matomo-org/matomo · GitHub or the next release.