Skip to content
Browse files

Outbound link event tracking

  • Loading branch information...
1 parent 8b9e760 commit 95b9bec10012c6c3cc5b4519d32cd3e3ba9bc967 @greghendershott committed
Showing with 15 additions and 13 deletions.
  1. +15 −13 index.html
View
28 index.html
@@ -31,6 +31,17 @@
}
</style>
<script type="text/javascript">
+ function recordOutboundLink(link) {
+ var category = 'Outbound Links';
+ var action = 'greghendershott.com';
+ try {
+ var myTracker=_gat._getTrackerByName();
+ _gaq.push(['myTracker._trackEvent', ' + category + ', ' + action + ']);
+ setTimeout('document.location = "' + link.href + '"', 100)
+ }catch(err){}
+ }
+ </script>
+ <script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-29709446-1']);
_gaq.push(['_setDomainName', 'greghendershott.com']);
@@ -42,15 +53,6 @@
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
- <script type="text/javascript">
- function recordOutboundLink(link, category, action) {
- try {
- var myTracker=_gat._getTrackerByName();
- _gaq.push(['myTracker._trackEvent', ' + category + ', ' + action + ']);
- setTimeout('document.location = "' + link.href + '"', 100)
- }catch(err){}
- }
- </script>
</head>
<body>
@@ -61,22 +63,22 @@
<br />
<a href="https://plus.google.com/u/0/107023078912536369392/about"
- onClick="recordOutboundLink(this, 'Outbound Links', 'example.com');return false;">
+ onClick="recordOutboundLink(this);return false;">
<img class="favico" src="https://plus.google.com/favicon.ico">
</a>
<a href="https://twitter.com/GregHendershott"
- onClick="recordOutboundLink(this, 'Outbound Links', 'example.com');return false;">
+ onClick="recordOutboundLink(this);return false;">
<img class="favico" src="https://twitter.com/favicon.ico">
</a>
<a href="http://www.linkedin.com/in/greghendershott"
- onClick="recordOutboundLink(this, 'Outbound Links', 'example.com');return false;">
+ onClick="recordOutboundLink(this);return false;">
<img class="favico" src="http://www.linkedin.com/favicon.ico">
</a>
<a href="http://last.fm/user/GregHendershott"
- onClick="recordOutboundLink(this, 'Outbound Links', 'example.com');return false;">
+ onClick="recordOutboundLink(this);return false;">
<img class="favico" src="http://last.fm/favicon.ico">
</a>

0 comments on commit 95b9bec

Please sign in to comment.
Something went wrong with that request. Please try again.