How to track Tweet Button clicks?

Oleksandr Skrypnyk picture Oleksandr Skrypnyk · Nov 4, 2010 · Viewed 7k times · Source

I want to track tweet button clicks via Google Analytics, but tweet button is an iframe with content from another domain. Is there some tricks to add callbacks for tweet button click?

Answer

Maelnor picture Maelnor · Jan 21, 2015

Or.. u can simply add event to your div and wait when this div well be clicked, like a:

<div class="clickMe">
   //twitter button there
</div>
<script>
$('clickMe').click(function(){
    //my awesome  code there
})
</script>

Sure, if you need only click, not callback.