Use of wildcards in the SearchEngines.php file


I am using Piwik on a large Intranet that is not connected to the Internet. We have our own Enterprise search page that offers search by web content, images, & videos. The difference is the parameters that get passed in the UI.

Web Content

Image Content…&source=images

Video Search…&source=video

I would like to track users coming from all three and which ones are bringing users to the websites. Since the values and parameters can change between the q= and the source=, I was hoping to use wildcards but I didn’t see an example of this.

// Image Search’ => array(‘Image Search’, ‘query’, ‘search.jsp?query={k}.&source=images’),
// Video Search’ => array(‘Video Search’, ‘query’, 'search.jsp?query={k}.
// Web Search’ => array(‘Web Search’, ‘query’, ‘search.jsp?query={k}’),

I did try something like this but it didn’t seem to be working. Is this do able and if so, can someone provide an example?


Anyone have any ideas about this?

(vipsoft) #3

No. That’s not what the URL path is used for.

The array contents are:

  • name of the search engine
  • the search/query parameter name when parsing the Referer; this can be a regex
  • a URL with {k} placeholder when creating links in the report
  • encoding

Brush up on your regular expressions; you should be good to go!


I really don’t understand what I am doing wrong here. Even a simple configuration doesn’t seem to track people coming from a search engine. They all are being marked as a Direct Hit.

My SearchEngines.php has this entry:’ => array(‘Enterprise Search’, ‘query’, ‘search.jsp?query={k}’),

When I write out my Refer on my website I am trying to track I see:

In the Piwik Console I would expect to see in the “Best Search Engine” widget
Enterprise Search 1

And in the List of Key words widget
mig 29 foxbat

Both of these continue to taunt me with “There is no data for this report.”