Google Analytics Tracking
-
I’m trying to add an onclick event to the Vote Up button. This is the code I’m trying to add:
onClick="_gaq.push(['_trackEvent', 'Event', 'Event',,, false]);"I’m trying to add it to this code:
$link_up = '<span class="thumbs-rating-up'. ( (isset($type_of_vote) && ($type_of_vote == 1) ) ? ' thumbs-rating-voted' : '' ) .'" onclick="thumbs_rating_vote(' . $post_ID . ', 1);"When I add it, it looks like this:
$link_up = '<span class="thumbs-rating-up'. ( (isset($type_of_vote) && ($type_of_vote == 1) ) ? ' thumbs-rating-voted' : '' ) .'" onclick="thumbs_rating_vote(' . $post_ID . ', 1); _gaq.push(['_trackEvent', 'Event', 'Event',,, false]);"But this isn’t right, I get a syntax error when I make this change. I don’t know too much about this.. can you help get this working correctly?
The topic ‘Google Analytics Tracking’ is closed to new replies.