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
www.mysite.com/search.jsp?q=

Image Content
www.mysite.com/search.jsp?q=…&source=images

Video Search
www.mysite.com/search.jsp?q=…&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
www.mysite.com’ => array(‘Image Search’, ‘query’, ‘search.jsp?query={k}.&source=images’),
// Video Search
www.mysite.com’ => array(‘Video Search’, ‘query’, 'search.jsp?query={k}.
&source=videos’),
// Web Search
www.mysite.com’ => 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?

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:
search.site.com’ => array(‘Enterprise Search’, ‘query’, ‘search.jsp?query={k}’),

When I write out my Refer on my website I am trying to track I see:
https://search.site.com/search.jsp?query=mig%2029%20foxbat&btn=Search&page=1&count=10&to=30&bbox=&source=&filter=&sort=&queryId=&drt=&dtstart=&dtend=&idx=&tab=_default&start=

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.”