Reputation: 51
I have a custom Facebook share button
<a id="postos" href="javascript:void(0)" onClick="gt=window.open('https://www.facebook.com/sharer/sharer.php?u='
+ link + '', 'gt','top=176,left=500,toolbar=no,location=yes,directories=no,status=no, menubar=no,scrollbars=no,resizable=no,width=800,height=50'); gt.onload
= function () {gt.focus();}; return false;"><strong><img src="http://i.imgur.com/I9G5EvC.gif" align="top" border="0"></strong></a>
I have also incorporated Google Tracking script with analytics.js
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new
Date();a=s.createElement(o), m=s.getElementsByTagName(o)
[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })
(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-41125028-4', 'auto');
ga('send', 'pageview');
ga('send', 'social', 'Facebook', 'share', 'http://goplaceses.com');
</script>
When going through real-time traffic I can't see this event happening, even when I click on it. It might be a problem that it isn't exactly a share button, but a button that opens Facebook share dialog.
How could I track this event?
Upvotes: 1
Views: 370
Reputation: 7359
Please take a look to how Komito Analytics does. See functions in the source code.
Upvotes: 2