with Google Tag Manager Auto-Event Tracking (dataLayer.push), I want to track this information:
the name of the links clicked in my menu, for example:
<ul class="my-nav"> <li> <a href="http://www.anothersite.com" target="_blank" rel="external">Anoter site</a> </li> </ul>
so: 'Another site'
- I want to push the name of the parent link name of the clicked link with this structure:
<li>Linkname
<ul>
<li>
<a href="http://www.website.com" target="_blank" rel="external">Website name</a>
<li>
<ul>
<li>
So there: I want 'Linkname'
the 'status' of a toggle link - whether the element has a class 'open' or not
<a class="content-toggler open" href="#">Hide all the content</a>
I have read through many tutorials and walkthroughs, but most talk about tracking links that go to external sites in general, or submit events and so on. Here I want to track the name of a link in a certain dom tree. And I want to track the element 'status' with a certain class.
Please explain how this can be achieved, or refer me to articles that have an example to this kind of events, not only to general walkthroughs.
Many many thanks!