How can I track subscription widget clicks with the new Google Analytics Universal Tracking Code?Google-Analytics Support tells me:
Place the following code within the code of your link:
onClick="ga('send', 'event', 'Subscribe', 'ClickonSubscribe');"
It should look something like this for your link:
<a href="javascript:void(0)" onClick="ga('send', 'event', 'Subscribe', 'ClickonSubscribe'});">Login</a>
I tried the following, but it won't track the clicks:
How can I track subscription widget clicks with the new Google Analytics Universal Tracking Code?Google-Analytics Support tells me:
Place the following code within the code of your link:
onClick="ga('send', 'event', 'Subscribe', 'ClickonSubscribe');"
It should look something like this for your link:
<a href="javascript:void(0)" onClick="ga('send', 'event', 'Subscribe', 'ClickonSubscribe'});">Login</a>
I tried the following, but it won't track the clicks:
<div style="font-size:medium; font-family:Arial, Helvetica, sans-serif; margin-bottom: 0px; width:400px" class="sendgrid-subscription-widget" data-token="0agm8fYMZnVfaMXF2pcYNMMNgOebibcbiVPF8r5hC9xyOKZxvWahyHzyfak6Slt23Ga6pRhFEbckPsibw3Yy5w%3D%3D"></div> <a href="javascript:void(0)" onClick="ga('send', 'event', 'Subscribe', 'ClickonSubscribe', 'SendgridSubscribeButton');"> <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://s3.amazonaws.com/subscription-cdn/0.1/widget.min.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'sendgrid-subscription-widget-js');</script> </a>
Any suggestions?