Tacking ClickEvent

stefano1975
Silver Contributor
Silver Contributor stefano1975

Hi all,

I have a site and I need to firing a call to action on a link.

 

To do this, I have defined a jQuery onHandler (1.7 and above) extension on this link and it's work correctly but the problem is that I have the same link with the same id/class in other URLs.

 

So, how I can trigger the event on a particular URL?

 

Thanks

3 REPLIES 3
Highlighted

Tacking ClickEvent

Paul
Rookie Contributor
Paul

Hello @stefano1975. Are you using Google Analytics? There is an event tracking video here that might help??

 

https://community.tealiumiq.com/t5/Tags-and-Client-side/Video-Event-Tracking-with-Google-Universal-A...

 

Tacking ClickEvent

stefano1975
Silver Contributor
Silver Contributor stefano1975
Hi, thanks for the link but the problem that I have the same link ID/Class for different URLs but I want that the handler defined it is firing only for an particular URL

Tacking ClickEvent

Tealium Employee
 
currently jQuery onHandler extensions don't have the functionality to specify conditions through the interface, so you won't be able to add the URL. 
 
 
However, a solution is to be more specific in your jQuery selector. This following link has examples of other selectors you can use besides id/class.
 
 
 
For instance, if your element has a unique attribute, you can use the Attribute Word Selector [name=”value”] selector.
 
Just as an example, let's say you have this element:
<a href="//api.jquery.com/category/selectors/">Selectors</a>
 
You can use this following attribute selector: 
a[href='//api.jquery.com/category/selectors/']
 
 
 
If another selector does not solve your problem, you can contact your account management and open a ticket in the following link. Once the ticket is opened an engineer will be assigned to help you with a more specific implementation.
 
 
Hope it helps!