Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 1st edition of the Target Community Lens newsletter is out now! Click to the right to find all the latest updates

TrackEvent get parameters from selected element

Avatar

Level 2

I want to track clicks on a few elements using a certain CSS selector. Right now, I'm adding a click listener using the JavaScript methods and using a for loop to add the trackEvent call to get parameters from the "my-custom-name" attribute in each selected element. Instead of using the document.querySelectorAll function to get parameters from the "my-custom-name" element attribute, is there a way to get those parameters and send them with the trackEvent call?

1 Reply

Avatar

Employee

@lonestarspock 

It would be more clear if you can show us what exactly are you doing via screenshot or the code itself.