Link to home
Start Free TrialLog in
Avatar of Chris Stormer
Chris Stormer

asked on

Issues Google Event Tracking and PHP " & '

I have code like this:

$returnString.='<a href="'.getUrl($value['fk_category_id'], 'category').'" title="'.$value['menu_item_label'].' Products" onClick="_gaq.push(["_trackEvent", "Menu", "Left", "'.$value['menu_item_label'].'"]);">'.$value['menu_item_label'].'</a>';

Open in new window


but I need it to be

$returnString.='<a href="'.getUrl($value['fk_category_id'], 'category').'" title="'.$value['menu_item_label'].' Products" onClick="_gaq.push(['_trackEvent', 'Menu', 'Left', ''.$value['menu_item_label'].'']);">'.$value['menu_item_label'].'</a>';

Open in new window


Basically the " I have in mine should be '

The example gives is: <a onclick="_gaq.push(['_trackEvent', 'category', 'action', 'opt_label', opt_value]);">click me</a>

Any suggestions on how to code this correctly..
ASKER CERTIFIED SOLUTION
Avatar of dsmile
dsmile
Flag of Viet Nam image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial