Tracking links with the same jQuery Selector

Gold Contributor
Gold Contributor
We are trying to track two links which have the same element class, both links must send a GA event with different "action". We don't know how differentiate them. Using the "Add jQuery Live Handle" tool of the Web Companion we obtain the same jQuery Selector. So we can't use the jQuery extension. Of course, we can't change the page code. Can we use another extension to send a GA event in addition to the Javascript Code extension? Maybe with the element-text or the element-URL? Any clue will be wellcome. Thank you
1 REPLY 1

Tracking links with the same jQuery Selector

Employee Emeritus
Vincente, You can accomplish this with the jQuery extension. Your selector would be something like: ".contEnlacesFoto a" (no quotes in the jQuery extension) Then you can dynamically set a data source equal to the text value of the link. To do this you would use the JS Code option. Set: "some_variable" To: JS Code -> jQuery(this).text(); Check out the picture also attached.
Public