Content tracking: Why isn't Matomo finding my content pieces within the content block?

Consider the following HTML markup:

<ul data-track-content data-content-name="Global Navigation">
   <li>
      <a href="/" data-content-piece="Start">
         <span>Start</span>
      </a>
   </li>
   <li>
      <span>Company</span>
      <ul>
         <li>
               <span>About Us</span>
            <a href="aboutus.html" data-content-piece="About Us">
            </a>
            <ul>
               <li>
                  <a href="team1.html" data-content-piece="Team 1">
                     <span>Team 1</span>
                  </a>
               </li>
               <li>
                  <a href="team2.html" data-content-piece="Team 2">
                     <span>Team 2</span>
                  </a>
                  <ul>
                     <li>
                        <a href="team2-people.html" data-content-piece="People">
                           <span>People</span>
                        </a>
                     </li>
                     <li>
                        <a href="team2-tasks.html" data-content-piece="Tasks">
                           <span>Tasks</span>
                        </a>
                     </li>
                  </ul>
               </li>
            </ul>
         </li>
      </ul>
   </li>
</ul>

I can only see Global Navigation - Start in Matomos Behavior > Content area. I can never see any of the other content pieces like About Us or Team 1, but they are all contained within the content block.
When I do manual tracking in the browser console it shows up in Matomo:

_paq.push(['trackContentImpression', 'Global Navigation', 'Team 1', 'team1.html']);
_paq.push(['trackContentInteraction', 'click', 'Global Navigation', 'Team 1', 'team1.html']);

The navigation is not added dynamically. Am I doing something wrong? Is the hierarchy depth too deep for Matomo to find the content pieces?

1 Like

Hi @dennis did you find any solutions? Iā€™m having the exact same issue, where the only piece detected is the first one.

Thanks in advance!

Hello @dennis,

I would also ask if you found a solution for this.

I currently also try to implement content tracking.

And I think its not possible to add different data-content-piece-elements in one data-track-content-block. Found info about this at Best practise for tracking multiple content pieces within on content block.

Is content tracking working on your site after all this time?

Best regards,

Timo

Is there any update on how the intention of @dennis should be properly implemented in the html code?