@garpeer opened this Issue on October 26th 2018

Hi!
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
https://www.example.com/tracking/piwik.php?c_n=Content%20Name&c_p=Content%20Piece&c_t=http%3A%2F%2Fwww.example.com&idsite=1&rec=1&r=669930&h=21&m=0&s=7&url=https%3A%2F%2Fwww.example.com%2Fde%2Fsuche%3Fq%3Dfoo&urlref=https%3A%2F%2Fwww.example.com%2Fde%2Fsuche&_id=a12d8585abf78f86&_idts=1540578212&_idvc=1&_idn=0&_refts=0&_viewts=1540578212&send_image=1&pdf=1&qt=0&realp=0&wma=0&dir=0&fla=0&java=0&gears=0&ag=0&cookie=1&res=1280x1024&gt_ms=116&pv_id=upDUGm

www.example.com/de/suche -> content is tracked
https://www.example.com/tracking/piwik.php?c_n=Content%20Name&c_p=Content%20Piece&c_t=http%3A%2F%2Fwww.example.com&idsite=1&rec=1&r=044145&h=21&m=0&s=33&url=https%3A%2F%2Fwww.example.com%2Fde%2Fsuche&_id=a12d8585abf78f86&_idts=1540578212&_idvc=1&_idn=0&_refts=0&_viewts=1540578212&send_image=1&pdf=1&qt=0&realp=0&wma=0&dir=0&fla=0&java=0&gears=0&ag=0&cookie=1&res=1280x1024&gt_ms=77&pv_id=a5ZBko`

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

Hi,

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

grafik

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.

Powered by GitHub Issue Mirror