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

PageViews with same PageViewId get counted as multiple PageViews #17833

Open
JE4GLE opened this issue Jul 29, 2021 · 3 comments
Open

PageViews with same PageViewId get counted as multiple PageViews #17833

JE4GLE opened this issue Jul 29, 2021 · 3 comments
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@JE4GLE
Copy link
Contributor

JE4GLE commented Jul 29, 2021

I set the PageViewId in the JavaScript tracker using the new feature in this pull request: #17655
This is discussed in the follow issue: #16942

When I for example hardcode the PageViewId, I get multiple PageViews. Even if they have the same PageViewId!

Expected Behavior

When two or multiple tracked PageViews have the same PageViewId, they should only be counted as one visit.

Current Behavior

Every tracked PageView gets counted as an individual PageView, even having the same PageViewId.

Possible Solution

Count PageViews with the same PageViewID as one PageView.

Steps to Reproduce (for Bugs)

...
_paq.push(['setPageViewId', "563adi"]);
_paq.push(['trackPageView']);
...

Reload page multiple times.

Context

I'm trying to merge the PHP tracker and JavaScript tracker. Everything possible will be tracked by the PHP tracker, then the generated PageViewId will be passed on to the JavaScript tracker. This will track the rest, like browser features or screen resolution.

Your Environment

  • Matomo Version: 4.4.0
  • PHP Version: 7.3
  • Browser: Safari 15
  • Operating System: macOS 12.0
@JE4GLE JE4GLE added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Jul 29, 2021
@tsteur
Copy link
Member

tsteur commented Jul 29, 2021

@JE4GLE from our side this is currently expected behaviour. The same page view ID can be tracked multiple times currently. Defining the pageview ID was mostly meant for being also able to track performance client side while you track the page view server side.

In your tracking code you probably will want to remove "trackPageView" call and replace it by enableHeartBeatTimer. This should probably make it work for your use case to track the page view server side, and the "ping" request from the heart beat timer should eventually send the performance data.

@tsteur tsteur added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Jul 29, 2021
@JE4GLE
Copy link
Contributor Author

JE4GLE commented Aug 4, 2021

I will try removing trackPageView to track the performance, thank you! Does this also track plugin information?

@tsteur
Copy link
Member

tsteur commented Aug 4, 2021

@JE4GLE I believe it doesn't track plugin information as this data is currently only tracked on the first tracking request within a visit which would be likely your server side "track pageview"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

3 participants