Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content Tracking not logged on a page with q= is in url ? #13648

Closed
garpeer opened this issue Oct 26, 2018 · 5 comments · Fixed by #13652
Closed

Content Tracking not logged on a page with q= is in url ? #13648

garpeer opened this issue Oct 26, 2018 · 5 comments · Fixed by #13652
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@garpeer
Copy link

garpeer commented Oct 26, 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
Copy link
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
Copy link
Author

garpeer commented Oct 26, 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
Copy link
Member

tsteur commented Oct 28, 2018

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
Copy link
Member

tsteur commented Oct 28, 2018

Could you give it a try?

@garpeer
Copy link
Author

garpeer commented Oct 28, 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.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Oct 28, 2018
@tsteur tsteur modified the milestones: 3.8.0, 3.7.0 Oct 28, 2018
@tsteur tsteur self-assigned this Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants