Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Example scenarios in assumption that we have
Interactions with popups content
enabled in the admin panel:User lands on a page with content tracking tags in the DOM
if content loads before tracker script fires, content will be tracked
User navigates from one page to the other page with content tracking tags in the DOM
tracker already finished it's initialization thus content will not be tracked
User sees a loader, then content with tracking tags in the DOM appears
there is a high chance that content will load after tracker finished initialization thus dynamic content will not be tracked
Problem with calling
trackAllContentImpressions
multiple timesThere is a dynamic component, like tabs (see login/register form example)
trackAllContentImpressions
current workaround
jstc exposes
clearTrackedContentImpressions
(although it is marked as internal and not documented) so we can use it to reset tracker's internal state before callingtrackAllContentImpressions
other possible options (changes in jstc required)
body
and check if clicked element was inside or has content tracking related tags. Similar how it's done with link tracking, This way we would not care if DOM changesMutationObserver
and scanning DOM for newly added elements with content tracking related tags