Quantcast
Channel: Web Development – Zack Katz's Blog
Viewing all articles
Browse latest Browse all 17

Yourls Google Analytics Link Tagging

$
0
0

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.

Google Analytics Yourls plugin

Download Google Analytics for YOURLS from Github

The plugin features include:

Define default tracking tags
You can define a set of default tags that are added to any link that gets shortened.

  • utm_source
  • utm_medium
  • utm_name
  • utm_term
  • utm_content

Override existing tags - you can choose to have your tags replace tags in the long URL that’s being shortened…or not.

Tagging options added directly to the URL form – the best feature in my opinion, you now have an interface to easily add tracking right from the link shortener.Add URL tagging options

Add query strings to the shortened URL to override or add any tracking tags. This feature has support for abbreviations, too.

If you want to see this in action, check out the links below.

Plugin Installation

To install, follow these steps:

  1. Download the file (updated to correct Github link)
  2. Upload the google-analytics folder into your users > plugins directory
  3. Go to your YOURLS plugins page
  4. Hover over Google Analytics, click “Activate”
  5. Configure the plugin settings by clicking the Google Analytics link in the menu

The post Yourls Google Analytics Link Tagging appeared first on KWS Blog.


Viewing all articles
Browse latest Browse all 17

Trending Articles