I have a goal in GA, and a matching onclick event on a button as follows...
<a target="_blank" href="http://amzn.to/2xr9Kgx" class="btn_bmi blue white" onclick="ga('send', 'event', 'BuyNow', 'click');">Buy Now</a>
When I click the link I should see the event fire in GA > REAL TIME > Events. However, nothing appears.
I don't get any console errors so the onclick event seems fine.
I thought maybe the "target="_blank"" was not allowing the JS to finish firing, but the onclick page remains in the browser so I don;t think that's the issue. Just in case, tho, I tested with just a regular link going to another page in the site. Still no event in GA.
If you want to see a sample page, hit this...
The onclick event is attached to the blue "Buy Now" button.
Thanks for any suggestions!