Storm news roundup 13-01-12

Our favourite web(ish) stories from the week…

Adam:

“The Raspberry Pi has started to be manufactured – in the Far East. The start of manufacturing is an achievement to be celebrated. The device, which will cost around £16-23, packs some serious punch:

‘HDMI for connection to a TV, USB for the keyboard, SD card for storage, and runs Linux on an ARM chip, with OpenGL ES 2.0 for the graphics. Its 700MHz ARM-11 processor is supported with 128MB of on-board memory.’

(source: reghardware.com)

The more expensive Model B chip will also come with 10/100Mb/s Ethernet. However, the fact that a UK charity is having to build a UK designed piece of hardware outside of the UK is not to be celebrated. They tried, boy did they try, but there was one significant stumbling block:

‘Simply put, if we build the Raspberry Pi in Britain, we have to pay a lot more tax. If a British company imports components, it has to pay tax on those (and most components are not made in the UK). If, however, a completed device is made abroad and imported into the UK – with all of those components soldered onto it – it does not attract any import duty at all.’

Now to my mind, that is just about as backwards as a tax system can possibly be when you want to encourage a resurgence in manufacturing in the UK. If you agree, please sign this E-petition.

Paul:

“The Education Secretary Michael Gove announced to broad acclaim (often from those of us unaccustomed to agreeing with him on anything much) from those in the software industry that the ICT curriculum is going to be overhauled, with a greater concentration on the fundamentals of computer science, logic and programming, rather than teaching people how to use products like Word and Powerpoint.

Gove summed it up pretty well: ‘Instead of children bored out of their minds being taught how to use Word and Excel by bored teachers, we could have 11-year-olds able to write simple 2D computer animations using an MIT tool called Scratch. By 16, they could have an understanding of formal logic previously covered only in University courses and be writing their own apps for smartphones.’ “

Mike:

“The Google ‘Search, plus your world‘ feature (put simply: Google+ network activity pops up as search results) has dominated lots of tech headlines this week. One of the most interesting pieces about it was this one on The Daily Beast which suggests that Google is actually doing this to break into Facebook’s walled garden, albeit in a fairly spectacular roundabout route…”

Felix, Liam and Andrew all picked up on the SOPA blackout story:

Felix:

“Reddit and I Can Has Cheezburger will be closing their sites on the 18th January in protest of the SOPA internet censorship bill, and Wikipedia editors are having a fierce debate whether to join in”

Liam:

“Next Wednesday, the ‘front page of the internet’, Reddit, will be turning off for 12 hours, to protest the proposed US law known as SOPA. They hope to encourage more websites to join them, with a few names stepping up to make a stand.”

Andrew:

“In news that can only further galvanize the growing anti SOPA coalition, the latest internet juggernaut has chosen to side with the likes of Reddit and Mozilla to send a message of defiance to the proponents of the impending ‘Stop Online Piracy Act’.

In what is being hailed as one of the most monumental days in the internets history, internet comedy auteurs ‘I can haz cheezburger’ has allied itself to the anti SOPA cause, choosing to blackout all aspects of it’s hilarious meme-based original content on the 18th of this month.

I can only say i’m glad that i can one day say to my future children that I witnessed it – the day the Berlin wall fell, the day Nelson Mandela was freed from his years of incarceration, and the day icanhazcheezburger.com went dark in protest to SOPA”


Using the Top Conversion Paths Report: Defining Custom Channel Groupings

 

The top conversion paths report is an awesome bit of kit; one of the five new multi-channel funnel reports in Google Analytics. The report shows a graphical table of the most common channels a user passes through to complete a site goal. The basic channel grouping is as follows:

Channel Description
1.Paid Advertising Visits from AdWords and/or links tagged with a medium of “cpc”, “ppc”, “cpm”, “cpv”, “cpa”, “cpp”.
2.Organic Search Visits from unpaid search on any search engine (i.e. medium=”organic”).
3.Social Network Visits from any of about 150 social networks.
4.Referral Visits from websites that are not social networks.
5.Email Visits that are tagged with a medium of “email”.
6.Feed Visits that are tagged with a medium of “feed”.
7.Direct Visits in which the visitor typed the name of your website URL into the browser or who came to your site via a bookmark.

Note that the channel listing follows an ordering process, in that visits which are not tagged as belonging to the first channel (Paid Advertising) fall through to the rule for the second channel, and so on. In the basic channel grouping, the direct channel also includes visits from a source/medium of “not set,” so that 100% of the site traffic is defined by this set of rules.

A classic example of how a visitor would interact with your site via different channels would be someone coming across your site via a Google search, bookmarking it, and then returning later via the bookmark to complete your goal:

Search, direct path

This is great, and with a table full of information like this, there is plenty of information to extract. However, the real power of the report comes in defining your own channel groupings. For example, in the above we see that the user originally came across the site by an organic search. We could create two channels to replace this one, breaking it down further into searches that already knew of your brand, and searches that came across your site with no prior knowledge of it (filtering by keyword.)

In order to set up your own channels, a simple way to do so is to edit the basic grouping. An easy way to copy the basic grouping template is found in the channel groupings drop down above the data set:

 

 

To move the channel ordering, drag on the grey boxes on the left of the buttons. Highlight the right hand side of a button to edit:

The interface is the same as in the search filter and advanced segments, so to create another rule highlight the “add ‘AND’ statement,” and select the dimension of keyword as below. Enter your brand name, and relabel the channel title before saving. Your groupings will also then be able to be used in the assisted conversions report.

 

 

From here, you can edit and create more channels to suit your needs. Track campaigns, visits through your blog, visits from your twitter account, visits from retweets, visits from apps and much more; giving you the vital information on how all these channels interact.

Although this report is hidden away deep in the goals section of the standard reports in Google Analytics, the information gleaned from it is priceless for any site owner.

Understanding Multi-Channel Funnels: An Introduction

Over the last year we have received a barrage of great updates from the chaps over at Google Analytics, with everything from an interface redesign to real-time monitoring of site traffic.

However my favourite of these recent announcements has been the inclusion of five powerful new reports under the label of multi-channel funnels. These new reports are sure to be highly useful tools for advertisers and business owners alike by allowing a more detailed analysis of how they are attracting the most important traffic to their sites.

The reports are found under the Conversions section of the Standard reports, and so in order to be useful, a site must have some Goals enabled. Note that goals do not have to be e-commerce related, but are an essential part of tracking and reaching the targets of any site. For example, if you run a small business and want to know who the people are that click on your contact page, you can set that up as a goal, and then analyse who accomplishes it – who converts.


An interaction with a site is defined by the visit received from a specific channel.  A channel can combine many different dimensions such as source, medium, keyword, campaign etc. The standard channels that the reports use are the following (for more info see here:)


Previously when trying to establish a picture of how effective specific marketing efforts were, Google Analytics would provide information of only the last interaction that led to a conversion. These new reports are extremely valuable as they can show us channels of visits to a site that a user makes within the 30 days before a conversion (provided cookies have not been cleared.)This is important, as a large number of visitors will browse around before eventually deciding to make a conversion.
Overview Report VennUnder the “Multi-Channel Funnels” heading, we are provided with five reports:

Overview Report – Provides a standard graph of goal conversions over time, allowing you to choose and compare between the conversions and assisted conversions metrics. Also includes a visualizer that produces a Venn diagram of conversions and assists between up to 4 selected channels:

Assisted Conversions Report – Allows you to compare the assisted conversions and final interaction conversions metrics. Also includes a ratio of the two, helping the user to analyse which channels spread knowledge of the site, and which lead to directly to conversions.

Top Conversion Paths Report – Shows in picture form, the paths that users took to convert. Also gives statistics on the numbers of people who took the specific path. For more info see here.

Time Lag – Give us information on how long users took to complete their path to conversion. Produces this in the form as below:

Time Lag Report
Path Length – Report produces a similar looking set of data to the Time Lag report, but instead of “Time Lag in Days,” shows us “Path length.”

Put together these reports give us valuable new insight into how a sites most important visitors access its most valuable content. For more information on the power of the top conversion paths report and on custom channel groupings, see our blog post here.

Today’s Gotcha: Localhost is not included in the ‘%’ wildcard when granting MySQL permissions

MySQL administration is one of those things I have to do pretty infrequently, so when I do there’s always something that trips me up and wastes a bit of time.

This week it was granting permissions on a database.

To grant permissions on a database to a user you use something like…

GRANT ALL ON db1.* TO 'user'@'hostname';

Hostname can also be ‘%’, which is a wildcard for any host.

My gotcha was that ‘%’ does not include ‘localhost’, so the locally hosted application couldn’t access the database that I could connect to remotely.

It’s not immediately obvious in the documentation that this is the case.  It says that ‘%’ “ applies to user_name for any host in the 192.168.1 class C subnet”, which of course in hind-sight does not include ‘localhost’.  While the local machine is in that class-C in most networks, the connection will come via the loopback address, not through an external network, so it’s origin host will not be in the ‘%’ set.

It can seem slightly counter intuitive but it makes sense when you understand a little more about what’s happening.

CoffeeScript, SASS and LESS compilation in Visual Studio 2010

I’ve been doing most of my development in Ruby on Rails over the past month and have fallen in love with the Asset Pipeline.  This is a process that lets you write in the new, more expressive forms and then compile and serve the raw CSS and JavaScript to the user.

The enhancements to CSS that are found in SASS and LESS are simply brilliant and save a massive amount of time.  Variables, nested selectors and mixins are just a few of my personal favourites.  CoffeeScript puts a wonderfully expressive veneer on top of JavaScript, removing lots of the grunt work and making your code much cleaner.

Using these improvements to the everyday languages has become second-nature and I’d be reluctant to go back.  Think about how much of a difference jQuery made to JavaScript DOM manipulation and animaton – you just wouldn’t want to go back to how it used to be!

However, my time is split between the Ruby on Rails world and the ASP.NET MVC world.  .NET doesn’t have native support for these new languages yet.  What’s a dev to do?

Continue reading

Today’s gotcha: CoffeeScript templates in Rails work in development but not production by default

Deployment is always a bit of a pain. No matter how hard you try there will almost always be a subtle difference between your dev and production environments (which is why ideally you should have a deployment test environment).

I had an odd bug today when deploying a Rails app.  I have an AJAX call, that returns a javascript block.  The template is actually a CoffeeScript file with the name check.js.coffee, the idea being that the CoffeeScript gets compiled to JavaScript before being sent out.

This works absolutely fine in development mode on my Mac.

Deploy it to the server and I get

ActionView::MissingTemplate (Missing template projects/check, application/check with {:handlers=>[:erb, :builder], :formats=>[:js, "application/ecmascript", "application/x-ecmascript", :html, :text, :js, :css, :ics, :csv, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json, :obj], :locale=>[:en, :en]}. Searched in:
* "/home/.users/70/revedadmin/online_editor/app/views"
* "/usr/local/lib/ruby/gems/1.9.1/gems/devise-1.5.0/app/views"
* "/usr/local/lib/ruby/gems/1.9.1/gems/kaminari-0.12.4/app/views"
):

The application is looking for check.js.erb or something similar.  It doesn’t know what to do with the CoffeeScript file.

It turns out that Rails won’t compile CoffeeScript templates by default, but you can install the Coffeebean gem and it magically works. It also has view helpers which let you drop CoffeeScript into an erb template like this…

<%= coffee_script_tag do %>
  alert 'coffee script is awesome!'
<% end %>

which is neat.

But the real gotcha is that this works out of the box in development mode, so you assume that it will work in development.

When in development mode, the asset compilation pipeline is appears to be compiling the CoffeeScript template at runtime. But with compilation turned off in production mode this no longer happens.

I assume this is not an intended behaviour as it rather breaks the idea of Rails apps working the same largely irrespective of the platform.  I will do some more digging.

Error: “No parameterless constructor defined for this object” when using Dependency Injection

There are several reasons you might see the error “No parameterless constructor defined for this object” but I often see it in conjunction with Dependency Injection.  My setup is .NET MVC with Ninject, but I imagine this is applicable to many other combinations.  I use constructor injection to pass services and repositories to my controllers.

The error is triggered when you request an instance of a service you have not wired up properly in your DI config.  It’s a classic case of the error message not actually telling you what the real problem is.  For example, I just added the new dependency on IDirectDebitProvider to my BillingController:

public BillingController(IOrganisationRepository org, IDirectDebitProvider dd)
{
    // implementation
}

However, I had not added the following line to my Ninject configuration:

kernel.Bind<IDirectDebitProvider>().To<SmartDebit>();

For more, read our getting started guide for DI with ASP.NET MVC.

 

Bug of the Day: Safari / Webkit trying to load gradients as images/URLs

Why is webkit trying to load my -webkit-linear-gradient’s as URLs?

I’ve got the following perfectly acceptable CSS3:

	background-image: -webkit-gradient(linear, left top, left bottom, from(#648087), to(#38484c));
	background-image: -webkit-linear-gradient(top, #648087, #38484c);
	background-image: -moz-linear-gradient(top, #648087, #38484c);
	background-image: -o-linear-gradient(top, #648087, #38484c);
	background-image: -ms-linear-gradient(top, #648087, #38484c);
	background-image: linear-gradient(top, #648087, #38484c);
	filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, StartColorStr='#648087', EndColorStr='#38484c');

I’ve spent a good 60 minutes this morning trying to find out why it was producing the following output in my ruby server console:

Started GET "/admin/-webkit-linear-gradient(top,%20rgb(100,%20128,%20135),%20rgb(56,%2072,%2076))" for 127.0.0.1 at 2012-01-10 11:43:41 +0000

ActionController::RoutingError (No route matches [GET] "/admin/-webkit-linear-gradient(top,%20rgb(100,%20128,%20135),%20rgb(56,%2072,%2076))"):

Well. It’s a bug, and it’s present in the latest released build of Safari. Safari still renders this fine, but it also tries to load it as an image, which’ll result in weird output in your ruby console, or error log.

It’s fixed in the latest webkit nighties, which should mean its fixed in the next safari build too.