简体   繁体   中英

Google Analytics and Custom Facebook Share

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?

Please take a look to how Komito Analytics does. See functions in the source code .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM