Hi Jack, this error comes usually when we add apostrophe in between of PHP code, whenever are using any other code like html or java script in PHP I recommend to use slash before the apostrophe. If we talk about your code I think you are using this button in PHP or printing this button dynamically.
See your code:
<button onclick="_gaq.push(['_trackEvent', 'category', 'action', 'opt_label', 1]);"></button>
You have to just add like:
<button onclick="_gaq.push([\'_trackEvent\',\ 'category\',\ 'action\', \'opt_label\', 1]);"></button>
Here slash (\) is saying to code please avoid apostrophe and code compile this line normally.
Try this it would help you.