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

piwik.js: Log an error if a content interaction was tracked but no content impression #8659

Open
tsteur opened this issue Aug 28, 2015 · 0 comments
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.

Comments

@tsteur
Copy link
Member

tsteur commented Aug 28, 2015

This is related to #6270 which is about making sure to track an impression was tracked when tracking an interaction.

Background:
When tracking a content interaction, it will be only shown in the UI or reports if there was also a content impression tracked having the exact same content name, content target and content piece.

This is usually not a problem as piwik.js will only track an interaction if we did detect an impression (and therefore tracked it). For example trackAllContentImpressions will detect all content blocks on a page and track an impression for them. This method also sets up the event listeners for content interactions. As piwik.js handles the impression tracking and event listener setup we make sure to track an impression and interaction with the same values.

There are some edge cases though. Eg when using trackVisibleContentImpressions we only track content blocks that were actually in the view part. There's a chance that we did not detect correctly an impression when it came into the view port but the user clicks on it meaning we track an interaction but no impression. A possible fix for this would be #6270. It is mainly a problem if one calls trackContentInteraction or trackContentInteractionNode() manually and forgets to call trackContentImpression or trackContentImpressionsWithinNode as well or calls those methods with different values.

I think we should develop both #6270 and this. I see this issue as a "safety net" to get notified in case there are edge cases etc. It is otherwise very hard to detect why a content impression is not shown in the reports.

From a technical point of view we should save all tracked content impressions in an array and when tracking a content interaction, loop over these impressions and if no impression having the same content name, piece and target was found, trigger a console.error (if console API is available)

@tsteur tsteur added Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc. c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. labels Aug 28, 2015
@mattab mattab added this to the Short term milestone Sep 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Platform For Matomo platform changes that aren't impacting any of our APIs but improve the core itself. 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

2 participants