Tracking Restaurant Orders in Google Analytics

Being able to see your basic website usage stats like visits and page views is good, but being able to understand what channels drove more revenue and transactions is even better. A vast number of web analytics software provide the flexibility to do this type of custom tracking, but little do we know the advantages it can bring.

I recently began testing a more unique usage of Ecommerce Tracking in Google Analytics for restaurant websites. And so far, it’s been a fairly smooth sail. If you’re just starting with Ecommerce Tracking in Google Analytics, I recommend reading Justin’s 4 part series on this subject on his blog.

One might think that Ecommerce tracking is only for online stores. And yes, it’s been built right from the start to serve online retail websites that have a checkout engine. But, any website can have its own funnel and way to convert visitors into monetary gains. My approach from the very start was; “how can I fill as many of the fields with the relevant data points on a food order as possible?”

The Restaurant Scenario

Local restaurants struggle to keep up with all the activities that are happening online. They:

  • Don’t have the bandwidth to manage their online presence;
  • Lack the knowledge to do things right that will drive results; and,
  • Shouldn’t have to because they should focus on what they do best; Cook!

Some of you may dined at a Cathay Restaurant in Ottawa at some point (if you’ve ever visited the city). My family used to own that. About 2 years ago, we sold it as the partners, including my dad, were ready to retire. The restaurant business was also becoming more fierce as more variety started to hit the city. One of the struggles was online. We didn’t have an online ordering system. As a result, there were customers that we lost because we didn’t have an online menu for them to place an order without needing to pick up the phone and calling. I see two benefits with online food ordering systems today:

  1. It gives local restaurants another acquisition medium to gain more customers;
  2. Reduce mistakes on delivery addresses and orders; and,
  3. It relieves the stress and reduces the amount of work for employees who answer phone calls to take orders.

Almost every restaurant will offer delivery and takeout services. This is essentially what we want to track in our analytics backend. So yes – this requires communication between two systems; your database for where orders are stored and Google Analytics. By creating a communication channel between these two systems, we can start to answer the following:

  • How many delivery / takeout orders were places over a time period in relation to our website traffic
  • Which day(s) do people visit the website more, and does that correlate with online orders
  • What combinations of food orders are most popular for online orders
  • What is the most popular dish for online orders
  • From what sources / mediums were most orders driven from
  • What sources / mediums assisted in the converting of a customer
  • # people who viewed our menu and left
  • # people who viewed our menu, proceeded to checkout and left (unsuccessful conversion)
  • and probably more…

Being able to look this data and determine what sources drove more online orders is, to a business owner, golden! As an analyst, I would then be able to go back to my client and tell them where they need to invest more money in order to drive more qualified traffic and conversions.

I’ve been in luck to work with’s online ordering system, injecting their’s systems data (transactionID, items, etc.) inside Google Analytics. Their system is robust, clean and serves local restaurants owners well. They are also a cost-effective solution for any business what requires a custom website and an online ordering system. and google analytics logo

Getting this into Google Analytics

For e-commerce tracking to work in Google Analytics, we will need to turn the Google Analytics e-commerce tracking option ON in your profile settings, and then add a few lines of code to our receipt page.

Step 1: turn on e-commerce tracking in admin > profile > profile settings

ecommerce profile setting in google analytics

Step 2: write the code and upload it to the receipt page

There are three methods we need to call: _addItem(), _addTrans() and _trackTrans(). I’m not going to go through the nitty gritty so you’ll have to either follow the detailed documentation or check out the 4 part series I mentioned earlier (it’s awesome again). But let’s walk through how we define our methods / variables.

The _addItem() method is where we add each individual dish from our menu. For instance, we may have the following:

_addItem(transactionId, sku, name, category, price, quantity)

  • transactionId = orderID
  • sku = dishID
  • category = delivery/takeout
  • price = price of the dish
  • quantity = number of orders per dish

For the addItem(), you may even add a Delivery Fee to your order list if delivery was selected. When takeout is selected, you will need to disregard the delivery charge.

_addTrans(transactionId, affiliation, total, tax, shipping, city, state, country)

  • transactionID = orderID
  • affiliation = restaurant name
  • total = total after taxes and other charges
  • shipping = tip amount
  • city, state, country = disregarded, I didn’t use these fields

Finally, in order to push this information into Google Analytics, we need to execute the _trackTrans() method. Once that happens, you should start to see this data populate in your Ecommerce Reports.

How does the data look inside Google Analytics?

You’re probably wondering how this data populates into the Google Analytics reports… here are a few screenshots of the data I’ve got right now:

ecommerce overview report

The E-commerce Overview report will give you high level performance metrics for a given timeframe. It will how you the how well your site converted your visitors, how much money you made, how many orders were placed and the average value of each order.

google analytics ecommerce transaction report

The e-commerce Transactions report will break down each order transaction, detailing the revenue, tax, delivery tips (if delivery was selected and the customer confirms a % tip on the site prior to checkout) and the amount of dishes per order.

conversion by source

This is cool – for the first time, restaurant owners can see where most of their “qualified traffic” is coming from. This All Traffic (under Traffic Sources) report breaks down by source / medium where most visitors came from, and from where they converted. *Valuing a source requires us taking a look at the amount of traffic and transactions that took place. So while Bing has a high per visit value, it didn’t drive nearly enough traffic and sales as Google organic. It’s interesting to see other mediums like Facebook, Urbanspoon, TripAdvisor and Yelp driving sales too.

google analytics mobile ecommerce report

How many orders came from mobile device compared to desktop?

Closing Thoughts

The steps to implement this properly to bring accurate / real-time data into Google Analytics was definitely a walk in the park. It required some creativity, careful planning and some technical skills to get custom code up and running. Google Analytics offers a good solution for tracking restaurant orders, but it could be better.

Because the commerce tracking fields are limited to the variables outlined above, there are a few things that I was hoping to include but couldn’t:

  • Upsell items (i.e. pizza toppings often come at an additional cost. If toppings could be grouped within an item, that would be cool!)
  • Categories for transactions (currently we are only able to categorize items, which makes sense from an ecommerce standpoint. Categories for transactions would allow us to categorize delivery and takeouts).
  • Payment methods – cash on delivery, credit card or debit are often the sorts of options that delivery services offer these days.

I would be happy to hear if anyone’s gone through this exercise before and if they saw benefits of this feature for restaurant websites. If you have any other ideas for me to try out, please let me know below!

Jackson Lo

Jackson is the Analytics / SEO Manger at adjump media and MENU.CA. His expertise spans from digital marketing (search engine optimization, local search marketing) to digital intelligence (digital analytics, data analysis). Very passionate about what he does, he also has big interests in photography and travelling.

More Posts

Follow Me:
TwitterLinkedInGoogle Plus

  • Andy Scott

    Once universal anlaytics is released to the general public you should be able to push those last few wishes through with custom dimensions.

    I too have considered what restaurant data might look like in Google Analytic. Great read!

  • Jackson Lo

    Thanks for stopping by Andy. It will be really interesting to see custom dimensions at work once it is public. There are a number of new features in Universal Analytics that I’m excited to try using. Just gotta wait now…

  • Jesper

    Payment method can be tracked using custom vars, I’ll recomend this blog post about ecommerce and custom vars.

  • Jackson Lo

    Thanks Jesper. I read this post a while back and was going to start using custom vars for coupons, but haven’t dabbled in there yet :) I wonder, though, how much more insights we can get from small sites like these (menu, checkout, about, contact) with custom vars. If we follow someone who came to our site and made a purchase with a CC, what can we conclude from their behaviours on our site? Order patterns maybe? But we can see that in our separate database where we built a profile for that customer and their order history. Neat idea though and will most definitely be trying out custom vars on restaurant sites soon (hopefully).

  • Stephen Brown

    Jackson, was the receipt page on domain, so all you had to do was have put the analytics code onto the page, or was the receipt page on your domain?

  • Jackson Lo

    No – each domain has their own receipt page. We’ve set it up so the basic analytics code is loaded in the header and the only piece we change is the UA.

  • Stephen Brown

    Thanks Jackson, though I didn’t understand. A users makes an order for a restaurant on the domain, then once completing the order they are forwarded to a receipt page on the restaurant’s domain where the ecommerce methods are fired? So the pertinent variables (items ordered, cost, transaction id, total…) are passed along to the receipt page on the restaurants domain. If so, that’s awesomely convenient and a reason to push for

  • Jackson Lo

    Users place their orders on the domain of the restaurant, not From beginning to end, the user places their order on the restaurant’s domain.

  • Stephen Brown

    Well that makes ecommerce tracking a breeze!