Visualizing the sales funnel: A simple template

Click to get a downloadable version of this slide

One of the best ways to analyze the performance of your e-commerce site is with a sales funnel — a visual representation of users’ progress through your site from a landing page to a completed sale.

As with any visualization, the value of a good sales funnel flow chart is that it instantly clarifies and enlightens in a way that a big blob of numbers in a spreadsheet just can’t.

This is why I am sharing my version of a sales funnel template — this is a simple four-step process that you can add your own numbers to and then share with your colleagues. Whether you work in marketing, product, or business intelligence, this slide will be a very handy addition to your presentation on user behavior.

Note: Most analytics tools (like Google Analytics) will give you the ability to build your own bar graph funnels in their user interface, however they don’t tend to give quite as much detail as above. If you are using GA, you can create a Goal Flow funnel report.

Inputting your own data

Like the look of this, but not sure how to get this data yourself, or where to input it? Let your good friend Randall walk you through this process …

There are a LOT of analytics tools on the market, but I will show you how to do this with Google Analytics, since it is an industry standard tool, and, well, chances are that your organization is using it.

Essentially, to get your data, you need to create a separate segment to show the number of users who made it to each stage of the funnel, like so:

Step 1: All users who made it to the landing page
Step 2: Users who have seen the landing page and the shopping cart page
Step 3: Users who have seen the landing page, cart, and checkout
Step 4: Users who have completed the whole cycle. The segment template

If you want to double-check any of these numbers you can just add a separate condition to exclude users who saw certain pages — for example if you wanted a number of users who only made it to the shopping cart page, you would create a segment that included users who saw the landing and cart pages and excluded users who saw the checkout and the success pages.

Once you have these segments, just load them into your Google Analytics property and you will have your user numbers to plug in.

And, hell, to make it even easier for you, I’ve done all the math in an R script, which you can see on Github right here. Just plug in your values where necessary (I’ve labeled them appropriately) and run the whole thing and you will have all of your percentages to stick on the slide. The mobile and desktop stuff is, of course, optional.

Build your own funnel chart in R

If you would rather just build your own basic funnel chart in R, here’s the code to do so:

#create a simple data frame      
step= c('1. Product Page','2. Shopping Cart','3. Checkout','4. Purchase')
users = c(50000,10000,5100,3825) #add in your own numbers here
ratio = users/users[1]
sales_funnel <- data.frame(step,users,ratio)
#format the data for creating the chart
all <- subset(sales_funnel,ratio==1)$users

sales_funnel$padding <- (all - sales_funnel$users) / 2
molten <- melt(sales_funnel[,-3],id.var = 'step')
molten <- molten[order(molten$variable,decreasing = T),]
molten$step <- factor(molten$step,level = rev(levels(molten$step)))
#make the chart
funnel_plot <- ggplot(molten, aes(x=step))  +
geom_bar(aes(y = value, fill = variable),stat='identity', position='stack') +
geom_text(data=sales_funnel,aes(y=all/2, label= paste(round(ratio*100), '%')),color='black') + scale_fill_manual(values=c("#009E73",'NA')) +
coord_flip() +
theme(legend.position = 'none') +

And the result: