I am trying to track clicks on an external link (without using a "redirect page").
How can I capture an event when a user follows a link, regardless of whether the user:
- Left clicks on the link
- Right clicks on the link and open it in a new window
- Use the keyboard to activate the link
- Is there other ways to activate a link?
The onClick event only applies to the first.
If setting href="javascript:fireEventAndFollowLink()"
the user will not be able to open the link in a new window (2), so this is not a solution.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…