Short URLs for fun and marketing

During a discussion in the BBM Group “Baby Steps: BB Dev”, we were talking about apps sales and how to get more downloads. It was mentioned that in a recent developer survey, it was found that the more time a developer spent on marketing, as a percentage of development, the number of app downloads increased. A basic business principle, spend money on marketing to increase sales. After sharing this tidbit with the group, the discussion turned to tracking app reviews from different sources to see which ones are the most useful for increasing downloads. I had already started working on a web dahsboard for getting and displaying download reports from the BlackBerry Vendor Portal. The next logical step would be to compare clicks from app reviews to downloads of the app. I knew that you could create marketing campaigns, which added information onto URLs, in order to track clicks. However, I couldn’t imagine someone putting a very long URL on their review site, nor people sharing it for others to click. Sites like TinyURL will create shortened URLs for free, but I wanted more control over the URLs, which brought my search to YOURLS.

YOURLS:Your Own URL Shortener is straight forward in name and function. It is a PHP based web app that gives you and admin panel for customizing your URL shortener and tracking clicks for each URL that you make. It even has plug-ins to help you do even more customizations, including adding Google Analytics Marketing Campaign parameters to the URL. But first, you need to set it up.

I didn’t want to put YOURLS in my root directory, because I didn’t want any chance that it would interfere with my WordPress setup. So, I created a folder and unzipped the files into it. I did the configuration file steps and pointed the app to an existing database that includes my download table. I used the same database, because I plan on linking the data together at some point. After pointing to the admin page and logging in, everything was up and running. Simple.

Now, I could make short URLs that looked like http://deanlogic.com/yourls/shorturl. Well, that wasn’t short enough and I wanted to get rid of the extra slash. Of course, that’s where subdomains come in. I set the yourls directory to the subdomain of “y”. Why? Well, I couldn’t think of another letter or number that would be better, so “y” is it. After a bunch of fiddling with the config file and. htaccess in the yourls directory, I figured out the right setup.

First you need to remove the yourls directory in two places in the htaccess file.

# BEGIN YOURLS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /yourls-loader.php [L]
</IfModule>
# END YOURLS

Next you need to update you YOURLS Site parameter in the user config file.

define( 'YOURLS_SITE', 'http://y.deanlogic.com' );

Again, simple. Well, it took me a while to figure it out. I even tried a YOURLS plug-in that almost worked. Now my shortened URLs looks like this http://y.deanlogic.com/shorturl or as in the one created for this post http://y.deanlogic.com/d

After this is all setup, you can add a WordPress plug-in called YOURLS Link Creator that will let your site automatically create shortened URLs when you save a post. Just install and fill in the correct information to connect your personal YOURLS to the plug-in.

Here is what the click tracking screens look like.

YOURLS admin stats

The stats include information about where the user is who clicked the link.
YOURLS admin location

I added a QR Code plug-in that shows up in the Share URL information.

YOURLS admin share

About DeanLogic Passport
Dean has been playing around with programming ever since his family got an IBM PC back in the early 80's. Things have changed since BASICA and Dean has dabbled in HTML, JavaScript, Action Script, Flex, Flash, PHP, C#, C++, J2ME and SQL. On this site Dean likes to share his adventures in coding. And since programming isn't enough of a time killer, Dean has also picked up the hobby of short film creation. This is my Passport account (formerly my Z30 account) . Any posts made by this account were created Working Wide with my BlackBerry Passport device.

About DeanLogic Passport

Dean has been playing around with programming ever since his family got an IBM PC back in the early 80's. Things have changed since BASICA and Dean has dabbled in HTML, JavaScript, Action Script, Flex, Flash, PHP, C#, C++, J2ME and SQL. On this site Dean likes to share his adventures in coding. And since programming isn't enough of a time killer, Dean has also picked up the hobby of short film creation. This is my Passport account (formerly my Z30 account) . Any posts made by this account were created Working Wide with my BlackBerry Passport device.