@garpeer opened this Issue on October 26th 2018

First thanks for making matomo, it is really a great tool!

I've been trying to figure out why the content tracking does not work on our site, and it seems to me that the content tracking impression/interaction are not logged if I'm on a page with an url like www.example.com/de/suche?q=foo

I'm using Matomo 3.6.1

I tried registering content impressions via the JS API, if i'm on the first url with ?q=foo, it does nothing (doesn't even show up in DB), on the second url without params it works as expected
_paq.push(['trackContentImpression', 'Content Name10', 'Content Piece', 'http://www.example.com']);

The two requests sent by the js:

`www.example.com/de/suche?q=foo -> content is not tracked

www.example.com/de/suche -> content is tracked

I tried a few variations now:
?q=1 - doesn't work
?q= - works
?q - works

Am I missing something?

@Findus23 commented on October 26th 2018 Member


Have you enabled Use default Site Search parameters in the website show?


This causes Matomo to track www.example.com/de/suche?q=foo as a search instead of a pageview.

@garpeer commented on October 26th 2018

Yep, my problem is then, that i want to track the interactions of a content block that appears only on certain search result pages. Is this somehow possible?

@tsteur commented on October 28th 2018 Member

That does sound like a bug. I haven't reproduced and don't have my IDE open but looking at this file I think the problem is here: https://github.com/matomo-org/matomo/blob/3.6.1/core/Tracker/Action.php#L49-L50 It might work be swapping the order of those two lines

@tsteur commented on October 28th 2018 Member

Could you give it a try?

@garpeer commented on October 28th 2018

I don't have a php dev env right now, but I just tried it on our live tracking (wise, I know) and it seems to solve the problem. I get content impression, content interaction and the site search logged too.

This Issue was closed on November 21st 2018
Powered by GitHub Issue Mirror