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:

google analytics tracking adobe flash library.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -