Learned how to code and built this website for $10!

Image

It’s finally complete! The site is not overly complicated, it’s a Reddit-style site called Linkditt.com (I know what your thinking, I will replace that logo!). Essentially, users can view links posted by other users as well as vote them up and down, which in turn add or subtract points from the user’s overall score (like Karma). There is a “comment and share” page where users can use the Disqus commenting platform and share the post on their favourite social media platform.

There are several implementations that you will notice as you navigate the site:

  • Infinite scrolling for posts, like you would see on Twitter
  • Automatic sign in following signup (no need to remember your username!)
  • Responsive design for mobile
  • Password retrieval email system
  • View all your past posts and edit them

There are tons of other little nuances that took me a while to wrap my head around. For instance, when you vote on a post the system knows how you voted previously (if you voted) and adds or subtracts a point depending on how your latest vote. You can’t accumulate votes for the same post this way. The problem here is that when you place your vote you should only see the posting’s total vote count go up or down by one. Originally, I had this going back to the database and pulling whatever the score was on that post but if you had many people voting at the same time, as they do on Reddit,  then that number could jump by however many users voted since you refreshed your page. You might click up and the number could jump by five or ten votes! Thus, I had to implement a system that just added one to the number already on your page while ensuring that you stay within the +1 to -1 voting range. This is one of those things I took for granted from other sites before making this one!

I made a big point about keeping this development cheap. So far the only money I have spent has been the $10 for the URL from GoDaddy.  That’s it! The server is free from Heroku. I use a free Pingdom account to keep the free server awake and responsive. All packages implemented into the code are absolutely free. I’ve had to learn some jQuery and Javascript to improve on user experience and I intend to add to this in the future. Other languages necessary to get this up and running are Python, the Django framework, CSS, HTML5 and the Twitter Bootstrap front end framework.

For me, this proves that you can learn to code (a very useful skill nowadays) for very little money. If you have access to a computer and the internet all it takes is being very curious and very determined.

Survival Analysis for Online Marketing Channels

Valuing your customers can take many forms. Generally LTVs do this quite well but often you need more depth into the quality of your customers. A great indicator of quality customers are those that purchase at a faster rate. For instance, customers that made their second purchase sooner are generally much more likely to become high valued, or high LTV, customers. This is where Survival Analysis comes handy.

What is Survival Analysis?

Survival Analysis deals with the analysis of time duration until one or more events happen, such as death in biological organisms. Traditionally it hasn’t been used in marketing until very recently. Implementing it can be relatively simple with the right SQL queries and an R package.

The Business Case

You know the LTVs of your segmented customer base but you also want some more insight into the predictive nature of how you can get more of those highly valued customers. You also know that the sooner that second purchase is made the more likely they are to becoming great customers. But how soon does that purchase need to be made? Can you influence that second purchase? And which channels, or segments, provide the customers most likely to purchase sooner?

Implementing the Analysis

Take a sample set of data large enough to be statistically significant for each segment. Ensure that there aren’t any factors that could skew the data. For instance, for one client I knew that they had implemented a new shipping threshold that fundamentally changed customers purchasing habits so I purposefully only selected customers that were only exposed to these new shipping policies. Then, segment these customers using dummy variables. These segments should be useful indicators, such as channels the customers were acquired through (ie. Google CPC, Facebook, etc) but also they could be subscribed to your email newsletters, purchase particular products, or are a part of a club. Your data should look something like this, where ‘Time’ is in days, ‘Event’ is ‘1’ for the second purchase taking place, and in this case, customers with 50 days never reach the event as the sample set only has customers observed for this time period:


time event googlecpc referrals affiliate emailsub
16 1 0 0 0 0
50 0 0 0 1 0
50 0 1 0 0 0
50 0 0 0 0 0
50 0 0 0 0 0
50 0 0 0 1 0
50 0 0 1 0 0
50 0 0 0 0 1
28 1 0 0 0 1
50 0 0 0 0 0
50 0 0 1 0 0
35 1 0 0 0 1
50 0 0 0 1 0
50 0 0 0 0 0
50 0 1 0 0 0
4 1 0 0 1 0

There are several types of Survival Analysis you can now perform. In this post I’m going to focus on a non-parametric function called Kaplan-Meier Curves, which is a series of horizontal steps of declining magnitude, which approaches the true survival function for that population. Your curves will look something like this:

Screen Shot 2014-02-28 at 12.14.26 AM

Here the graph is comparing Google CPC (googlecpc = 1) to all other data (googlecpc = 0). Generally, there should be a distinct drop off in the first few days as customers return (make sure not to include refunds!), and the curve gradually levels out as the probability of them returning becomes lower and lower. Also, notice that customers acquired by Google CPC are more likely to make that second purchase compared to all other customers.

Actionable Insights

Insights depend completely on your data and business. Email subscriptions tend to be a very strong indicator of return customers. Ensure that they subscribe to something that you are communicating your offers with. Following this analysis for one client, initiatives to subscribe customers to emails sooner ended up increasing the death rates of survival curves, meaning more customers reached their second purchase faster. A shocker was that the referral program actually had one of the worst survival rates. This prompted a review of that acquisition tool as well as a greater emphasis on other tools as they tested newer options out.

Kaplan-Meier curves also indicate when you should attempt to communicate with your customers before they are unlikely ever to return. In the curves above after 5 days there is a significant drop and about after 40 days customers are very unlikely to return. These could be great times to contact your customers with an opportunity to revisit your site to purchase again.

Conclusion

Survival Analysis is predictive in nature but remember that when you make changes based on your findings these curves will fundamentally change if you have used affective tools to reengage your customers. Just like other data you collect, use Survival Analysis as a constant gage to improve your purchasing funnels and acquisition methods by using the levers at your disposal.

Writer vs Writer

The only thing better than one opinion…is two opinions. Now, a user can choose to write an opinion article against an article already written. For example, the article below expresses an opinion, and just like before, that article and its author collect points based on the up (or down) votes given by other users. But now another user can choose to write an article with an opposing viewpoint should one not have already been written (see below).

Image

This is essentially a digital version of a head-to-head newspaper editorial accept that anyone can post them! You may have also noticed the new Twitter Bootstrap template with a new side bar menu. Most don’t work but it’s a sign of things to come!

Day: 18  Budget: $?  Spend: $0

Workspaces and updates

Workspaces have become a growing trend in the technology and startup space. A few years ago after I started my now defunct online dry cleaning startup I didn’t even know that these even existed. Now they seem to be sprouting up everywhere along with incubators and accelerators. A workspace is slightly different as the latter two options may require an application process and a very specific startup concept and plan to be accepted in as well as likely being funded by the government or by private investors (ie. Mars).

With construction at my condo working at home was just no longer an option, so I decided to rent a desk in the lounge space at a workspace called Project: RHINO (my project name is an ode to this space). The lounge space means I don’t leave any of my belongings after I leave for home. Almost daily you get the opportunity to meet someone new working on a unique startup or project. The founders themselves are working on their own startup, Clayza, and in fact, started Rhino completely by accident as they had only rented the space to start a previous startup a couple of years ago. Now, the Rhino boasts over 70 members and growing daily.

What is truly remarkable about the place is that, exactly as they state on their site, Project: RHINO is a community. Members are always interested in discussing everyone’s projects and more importantly, everyone helps everyone else out with their problems. Many of the people I have thanked on my blog are Rhino members who have generously donated their time and knowledge to my questions. Also, breaks and socializing are often taken over heated games of foosball or hanging out on the lounge area couches. So, if you work from home and you find that you need a great place to work, give a workspace a whirl, I guarantee you won’t regret it!

Updates on Project Blackfish:

1. Authors now receive points for comments made on their articles.

2. Articles now have tagging available.

3. All articles now have a topic to be filled out by the author.

The reason I’m not going into too many details over this blog is because I’m hoping to make a fundamental change and differentiator to the site over the next couple of days. I just have to figure out the right way to design and code it. So stay tuned!

Day: 13  Budget: $?  Spend: $0

Score your influence!

Project Blackfish has some amazing new updates! Remember last week when I mentioned that users could now unlike articles as well? Well, there was a problem with that system: users could like and unlike articles as many times as they wanted. That has now been solved after some very steep learning in Django, particularly learning one-to-one and many-to-one relationships.

So here’s the lowdown: In the screenshot below you can see that if a user viewing an article has not liked an article it will say “You scored it: Rate this article!”

Image

 

If the user clicks “like” the Total Point Score for the article increases by one as does the amount you scored it by. The trick here is that a user cannot like an article more than one time. They can become neutral again (Score = 0), or they can score it as -1. The user can change their score as many times as they want between -1 and 1.

 Image

Now here’s where things get really interesting! All articles are now tied back to the user that wrote it. When another user rates their article they receive Influence Points(iPoints). At the moment the user “test 4″ has 0 iPoints, after their article was given a like they then receive one iPoint. If the user rating the article goes back and changes their mind “test 4″ will have -1 iPoints. These points are accumulated from all of their articles so the more articles they write and the more users that like their articles the more iPoints they receive thus scoring their overall influence within the community.

ImageImageImage

Special thanks to Vikram, Vanessa, and Ildar for helping me with my logic and answering my never ending stream of questions!

Day: 8  Budget: $?  Spend: $0

Why open source is amazing

Everywhere, tons of coders are building software packages and making it freely available without making a dime off of it. I recently experienced a perfect example of just how useful and efficient this can be.

My goal was to have users fill in their city and country in their profile page, which I added recently:

Image

What I realized is that I don’t want to leave it up to users to spell their city and country correctly, so I went on the hunt for a Django app that contained our world’s geographical information. I came upon two separate applications that I could plug in to my site’s code: Django Cities and Django Cities Light. The former is a much larger and more complex program than I needed at the moment so I went with the lighter version. The only problem was that when I tried to upload the data I kept receiving a duplicate error for some city in Latvia: Daugavpils.

I scratched my head and went to work googling the error but nothing came up. Finally, after searching long and hard I gave up and opened my first issue report on Github. The main contributor, jpic, responded shortly afterward along with several other coders who had the same problem. Over the next few days back and forth discussion solved the problem and another bug that popped up immediately afterwards. I was so impressed with this amazing collaborative effort and in particular, that of jpic, who went to town solving these problems in which he received no monetary compensation for. Coming from a finance and economics background I really found this refreshing.

Without the contributions to the community of open source developers working tirelessly on software such as Python, Django, and Cities Light, we definitely would not have the kind of web based technology we have today.

Special thanks to jpic for fixing my issue so quickly.

Day: 7  Budget: $?  Spend: $0

Learn to code for free

I wanted to take a quick break on the progress of the site to quickly discuss learning to code. After spending a lot of money going to school, on both an undergraduate and a masters degree, I have decided that I never want to pay to learn again. With the amount of resources freely available online, for many things, in particular coding, you don’t have to.

After picking up SQL working at web startups I decided I should take the plunge and actually learn to code. I started with CodeAcademy and Zed A. Shaw’s LearnCodeTheHardWay. CodeAcademy allows you to practice your coding skills directly on their sight while LCTHW gets you to go through the necessary pains of coding through the command line. I actually went back and forth between the two because sometimes seeing the same thing explained different ways gave me a better understanding. Each site allows you to choose from various languages, deciding on the right one should be made using some careful research as to what you intend on doing with your coding skills. I chose to learn Python over other languages like Ruby because of its application to statistical packages and because of it’s reputation for being an easier scripting language to pick up.

For a framework I made the natural choice of Django since I studied Python. I think it is worth mentioning again Mike Hibbert’s video series available here, which I highly recommend.

If you find that you aren’t getting ahead as fast as you would like there are a number of great coding schools popping up that have hands-on classes lasting a few weeks. In Toronto there’s Hackeryou and the soon to be launched BrainStation.

Ultimately, with the amount of information freely available on the internet, you can learn just about anything. I’ve even learned to become a semi-competent guitar player without ever paying for a single lesson!

Day: 5    Budget: $?    Spend:$0    Total Amount Spent Learning to Code: $0 (I did have to buy a computer but I’m not going to count that)