-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
BugFor errors / faults / flaws / inconsistencies etc.For errors / faults / flaws / inconsistencies etc.
Description
May potentially be related to #6270
- I have single page application that features a search page
- Search results are manually using internal search tracking via
trackSiteSearch
- As per Piwik/Matomo recommendation,
trackPageView
is not called on the search page sincetrackSiteSearch
is already being called
// We recommend not to call trackPageView() on the Site Search Result page
- I am also tracking content impressions automatically using data-attributes and initializing via a call to
trackAllContentImpressions
- Interaction tracking is handled by Piwik automatically on click, for each content block
The steps to reproduce this issue
- Perform a search query
-
- the content impression should now be tracked for the items in the search result
-
trackSiteSearch
is called
- Click on the trackable content in search result
-
- on page transition, the interaction is tracked
- Navigate back to the Search results page by clicking the back button in the browser
-
- the content impression is not tracked for the items in the result
-
- click the trackable content in search result
-
- on page transition, the interaction is tracked
The above steps will result in more content interactions than content impressions for the content block that is interacted with.
I believe the issue emanates from the fact that on back navigation, all content impressions are not registered in Piwik even though a call is made via trackAllContentImpressions
, because a call to trackPageView
is not made to force Piwik to register the impressions?
As per Content Tracking section:
We won't send an impression of the same content block twice if you call this method multiple times unless trackPageView() is called meanwhile. This is useful for single page applications.
EDIT:
After a bit of further investigation, it does not seem that failure to call trackPageView
is the cause of this issue. Manually, adding a call to trackPageView
still allowed reproduction of the issue
Metadata
Metadata
Assignees
Labels
BugFor errors / faults / flaws / inconsistencies etc.For errors / faults / flaws / inconsistencies etc.