Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- (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-XXXXXXXX-X', 'domain.com');
- ga('send', 'pageview');
- </script>
- <script type="text/javascript">
- function recordOutboundLink(link, category, action) {
- try {
- ga('send', 'event', 'category', 'action');
- } catch(err){}
- setTimeout(function() {
- document.location.href = link.href;
- }, 500);
- }
- <a class="post" onclick="recordOutboundLinks('Outbound Link', this.href); return false;" href="http://www.external.com" rel="nofollow">Click here</a>
- <script type="text/javascript">
- function recordOutboundLinks(category, link){
- try {
- ga('send', 'event', category, link, {'hitCallback': function() {
- document.location.href = link;
- }});
- } catch(err){}
- }
- </script>
- <a class="post" onclick="recordOutboundLink(event, 'Outbound Links', 'domain.com');" href="http://www.external.com" rel="nofollow">Click here</a>
- <script type="text/javascript">
- function recordOutboundLink(event, category, action) {
- try {
- event.preventDefault(); // prevent default link action
- ga('send', 'event', 'category', 'action');
- } catch(err){}
- setTimeout(function() {
- document.location.href = event.target.href;
- }, 200);
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement