2

Please help, I want to track in Google Analytics, how many peoples click on this button enter image description here

Here is source code of button at that time: <a href='javascript:fg_popup_form("fg_formContainer","fg_form_InnerContainer","fg_backgroundpopup");' title="Bank PO Coaching Classes in Chandigarh _ Book Your Seat Today"></a>

2
  • Are you using Universal Analytics (ga. in your snippet)? It appears the button triggers a popup. Is that a lightbox in the current page, or a real popup in a separate window? Are you trying to track that this particular button was clicked as opposed to the popup being opened by some other mechanism, or are you really trying to track that the popup is being viewed? Commented Dec 5, 2016 at 11:38
  • I am using Universal Google Analytics. When button trigger, a real popup open in separate window(like a contact forum). Actually I want o track both: 1st how many people click on that registration button and second, after the 1st click, how many peoples filled that popup forum. Commented Dec 5, 2016 at 12:23

1 Answer 1

1

Have you tried this, something like this should do the job.

<button onclick="ga('send', 'event', 'Click Events', 'Button Click', '<param>'); >Button_img</button>

Remember to add other additional fields/parameters as necessary.

1
  • Google Analytics events are sent asynchronously. This will work in this page because the link is a popup. In general, you have to be careful about adding event tracking to links. The data may not get a chance to get recorded before the next page loads. Commented Jun 5, 2017 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.