Tag: javascript Posts

Track Outbound Links On Your Website

WordPress

I’ve been trying to track where exactly people go when they leave my website for a few pages recently, and wrote some code based on a few other examples on the Internet. Basically this bit of Javascript will force Google Analytics to log a special request so that you can see where the user went. It uses jQuery, so you have to make sure you have that included in your theme. Here’s some code that will let you track outbound links on your WordPress website. jQuery( ‘a’ ).on( ‘click’,function( e ) { var url = jQuery( this ).attr( ‘href’ ); var customName = jQuery( this ).attr( ‘data-link-name’ ); if ( !customName ) { customName = url; } if ( e.currentTarget.host != window.location.host ) { ga( ‘send’, ‘event’, ‘Outbound Link’, customName, document.title ); if (e.metaKey || e.ctrlKey) { var newtab = true; } if (!newtab) { e.preventDefault(); setTimeout(‘document.location = “‘ + […]

Ode To Google Reader

Technology

I’ve been using Google Reader as my main RSS reader for some time. For the most part, I’m pretty happy with it. They’ve recently added the ability to share items, which makes it far more interesting. The one thing I’d love to see though is the ability to add local comments on those shared items, comments that only my friends could see. So many times I’ve read items in my friends’ shared feeds and really wanted to say something, or get clarification. Going to the real site and posting a comment sort of implies a certain level of knowledge on my part (especially if it’s a technical discussion). However, that barrier is much reduced when talking amongst my friends, and I really would love to see side-channel discussions on shared items. That’s my request for the day. So Google, you missed my birthday a few weeks ago, but you should […]

WordPress Without Borders, Round Two

 Journal

Thanks to everyone who left some feedback the other day about the new translation plugin. I’ve had some really great comments about it, and even the odd person that’s really anxious to test it out. I’m hoping to put a version up online tonight for people to download and try for themselves. For those people who didn’t catch it, what I did was write a WordPress plugin that takes advantage of the Google AJAX language API to dynamically translate the content of my blog into whatever language you as a reader ask for (by adjusting your browser settings). This works in both directions: blog entries will be converted into other languages, and comments left in other languages will be converted as well. So basically, as a reader of this blog you can read it in whatever language you want, and comment in whatever language you want. Check out the comments […]

What Are You Up To Facebook?

Technology

This is a rather interesting move made by Facebook. Apparently on Friday they announced a new javascript library that would let you put Facebook applications on your own web page. Facebook announced Friday a new JavaScript client library that will allow Facebook apps to be displayed on any website. The client library allows users to make Facebook API calls from any web site and create Ajax Facebook applications on that website. Wei Zhu from Facebook explains the benefits: Since the library does not require any server-side code on your server, you can now create a Facebook application that can be hosted on any web site that serves static HTML. An application that uses this client library should be registered as an iframe type. This applies to either iframe Facebook apps that users access through the Facebook web site or apps that users access directly on the app’s own web sites. […]

Safari 3.0, Leopard and GMail

 Journal

For all of you people who upgraded to Leopard and are using GMail, you have have noticed a few weird things going on. For me, my contacts no longer auto complete properly, and periodically all the javascript in gmail stops working. I’ve checked a lot of newsgroups and many people are having the same problems. Apparently gmail has tried moving to a newer version that isn’t really compatible with Safari 3.0 yet. The solution is to just go up to the top right in gmail and click “old version”, which will roll back your GMail version to one that does work with Safari. You’re welcome 🙂