Yourls Google Analytics Link Tagging

In my last post, I wrote about the benefits of using YOURLS, a self-hosted link-shortening service. I’m finding that YOURLS is great, but it’s not perfect. Some of the issues I have experience are part of what you get using most URL shortener services.

Some of the downsides of using link shorteners are:

  1. Google Analytics doesn’t always capture the original referrer (and I have no clue how they do the rest of the time!).
  2. When generating links using the bookmarklet (or in this case, also the Yourls installation), there’s no easy way to add campaign, source, medium, content, and term tags for Google Analytics to track.
  3. Yourls doesn’t allow query strings on URLs by default, making overriding existing campaign tags difficult/impossible. For example: `http://katz.si/t?utm_source=2300`

I’m not the only one who wanted these things, so I’ve created a plugin that adds Google Analytics tracking to Yourls. It’s very cool.

Continue reading “Yourls Google Analytics Link Tagging”

YOURLS URL Shortener

YOURLS LogoI was having trouble finding the right URL shortening service. My requests for shortening were not too picky. I wanted two simple features:

  • Good statistics that are visible only to administrators
  • Edit the long URLs after generating shortened links

…but not one service has both features:

  • http://sn.im has editable URLs, a bookmarklet, but no stats. Oh, and they kept on deleting my links.
  • http://bit.ly has great stats, name recognition, but the links aren’t editable and the stats are public.
  • http://goo.gl is the fastest service (so they claim), they have good stats (maybe the best, since they include OS & browser information), but they don’t have editable links or private stats.

Other smaller offerings may have had both features, but they also seem unreliable. I wanted control of my links. Continue reading “YOURLS URL Shortener”

Export Bit.ly Link Data as CSV

Finally, a way to download Bit.ly link data as a CSV.

Bitly Download CSV
Would you care to download a CSV of your Bit.ly links? WINNING!

Download the plugin from WordPress.org

Bit.ly is one of the most popular link shortening services, and rightly so: it is stable, easy to use, and has pretty looking statistics. One thing Bit.ly does not do is export data. There is simple no other Bit.ly exporter out there.

The Bit.ly Exporter plugin allows you to export up to three years of daily click data for your links. This allows you to analyse click data like you always wanted to! All you need is WordPress. Continue reading “Export Bit.ly Link Data as CSV”

How to Add www. – or Remove www. – From Your URL

This has been done many times by others, but just a quick tip on how to add or remove www. from your website’s address. This is helpful for URL canonicalization and user experience consistency. You can also achieve SEO-friendly canonicalization using rel="canonical". Oh boy, I’m getting too technical 🙂

Here’s the juicy part:

Add the following to the .htaccess file in your website’s root folder (often named public_html or www). If there’s not a file named .htaccess, you may create it. If you are creating the .htaccess file, set the permissions to 644. For security reasons, you don’t want others to be able to write to this file. Continue reading “How to Add www. – or Remove www. – From Your URL”