onclick - Possible to track a div click with google analytics -
i have video playing within div on site. video requires click play. i'm wondering if possible apply analytic event tracking parent div tracks anytime there click within div.
i know can use onclick event analytics, not quite sure if applied div rather than, say, outbound link this:
<a href="#" onclick="_gaq.push(['_trackevent', 'videos', 'play', 'vid 1']);">click here</a>
has body ever done this? realize there downfalls (user repeatedly clicking play/pause) etc.
thanks.
*edit - should have mentioned unclear of how turn div clickable event.
say div . need make whole div onclick event?
you can this:
<div onclick="_gaq.push(['_trackevent', 'videos', 'play', 'vid 1'])" style="cursor: pointer;"> content here </div>
however: when place flash inside, there issues click propagation, depending on browser. better give library try:
Comments
Post a Comment