Select all class's with getElementsByClassName and click does not fire in dtm
Hi,
I have a carousel with 6 links on the homepage and am trying to capture each link click. I have set up a data element using css selector to capture the classname i.e. [class=navname]
I also created an event based rule with condition rule set to _satellite.setVar('Navigation' this.text) and added an evar,prop and events . Issue is that this only works on the first click, and not the others. I need this to click on all the other links.
I tried changing the rule to document.getElementsByClassName{'navname').click(); return true and it still only captures the 1st click and when i clicked on the others i get the link name for the first item returned for all the links.
How do i get this to click on all of the classes named 'navname' and return the correct navigation title? I thought maybe i need to declare a variable or something in the code editor.
please I need help as am just getting familiar with DTM