How to Set Up Funnels and Event Tracking in Google Analytics and MixPanel

Need WordPress Hosting?View Our Plans
Need WordPress Hosting?

Graphic of google analytics

Funnel analytics show your website’s ability to accomplish the goals that matter to your business. If you’re using your site to drive some activity (i.e. signups, pageviews, completing a survey, etc.), you need to make sure you have the right funnels in place. First we have a brief overview of event tracking and funnel analysis, and then we’ll walk you through how to set up funnels and event tracking in Google Analytics and MixPanel, with a little extra guidance on how to install analytics on WordPress.

Event tracking and funnels are the core elements of any analytics package; yet, they often go unused because people don’t know why or how to set them up.

What is Event Tracking?

An event is a consumer action, like clicking to a page, spending time on the site, or filling out a form. Tracking those events is the very first thing you should do with your analytics accounts.

Standard reporting measures—such as overall traffic, page visits, and those other metrics that are normally associated with analytics—aren’t worth much unless you have goals for which events matter specifically to your business. Then data can be evaluated according to how it meets your goals (otherwise it doesn’t matter.)

In Google Analytics, many events are tracked automatically, but you should still set up goals so that Google tracks the events that really matter to you. MixPanel, in contrast, only tracks the events you set up for tracking, which encourages you to focus on what matters and not get swallowed up in the extensive data and reports available in Google Analytics.

If you are wondering whether to use Google Analytics or MixPanel, use both. We say that not just because ZippyKid uses both, but because Google Analytics can collect a lot of data you might want to use later, and MixPanel can help you set up very specific funnels for your purposes. Both are free to use (though MixPanel charges for high usage.)

Also, by the end of this article, you will have a good idea of the different funnels each service provides.

Overview of Funnels

A funnel measures the flow of visitors through a specific process, such as a sales process, a training process, or the checkout process. You primarily want to measure those things that occur as close to the point of sale as possible, because any improvement there has a direct effect on revenue.

A funnel report actually looks like a funnel—wide at the top and narrow at the bottom, meaning more people start the process than those that complete the process. For example, out of 100 visitors to your product page you may have 50 of them add stuff to their cart, 25 click to purchase, and maybe 8 people complete payment. At each stage, some of them drop off and you want to know how many.

At the end of the funnel is a goal that matters specifically to your business, like a sale or a newsletter signup. The ultimate goal is what counts in your business, but you want to know about all the factors that contributed to that goal. A funnel is perfect for this.

The funnel report enables you to visualize and get a lot of valuable information about how effective each page in your process is. A checkout process is the ideal candidate for funnel analysis, so it will be used in the examples below.

Comparing Google Analytics and MixPanel Funnels

Google Analytics is a huge, broad, almost overwhelming tool. MixPanel is simpler and more specialized. It specializes in “cohort analysis,” a really cool report of how individual people move through your site—which you can’t quite replicate in Google Analytics.

Google Analytics provides a broader array of data and the option to create ridiculously customized reports. Whatever more specialized analytics tools you use, be sure to install Google Analytics as well.

As for funnels, Google is a little more complex to set up, but its data collection is automatic and its reports are great. The advantage of a MixPanel funnel, however, is that it tracks more than URL events within the funnel, such as social sharing events (if you choose to set them up). Also, MixPanel funnels have the option to include A/B test results for each event in the process, right in the funnel report, which is a real timesaver.

How to Install Analytics on WordPress

To install analytics on WordPress, first create a new account with Google Analytics. Be sure to insert the URL of your site’s root homepage exactly how it shows on your browser.

If you have selected the “A single domain,” which is the default option and is most likely what you want to do on WordPress, then you will only need to copy and paste this code once in your header template, which by default loads on every page on your site.

Alternatively, there are several plugins that will take care of this for you. One of the more popular is Google Analyticator (available here: The Analyticator plugin uses Google OAUTH, and handles event tracking and page load times. You also get the option to track file extensions for downloads. Once this plugin is installed, Google Analyticator allows you to enter your user account number and it will install Google’s Analytics code for you. In addition, you can have quick access to some basic analytics information right from within your dashboard, as shown below:

If you are determined to paste the code in manually, the code generated should look something like this (You can always find this code by going to the admin, clicking on your account, and clicking the “tracking code” tab.)

For those of you who would like to hard-code analytics on your site, you can do that through your normal text editor. Alternatively, here is how you do that on WordPress:

Don’t forget to click the “Update File” button. Check your homepage to make sure it doesn’t have any new text on it, and then check Analytics to see if the code is installed. If not, you may not have copied the code completely, or you may have put it in the wrong spot.

If you’re not a programmer, WordPress has an easy plug-in that can walk you through installing analytics on WordPress in a jiffy.

No matter which method you use, you should now have successfully installed analytics. On to the next step!

Google Analytics Funnel Walkthrough

Goals in analytics are events that you track specifically, such as specific URL targets, time spent on site, and number of page views. A funnel in Google Analytics is actually a kind of URL goal that just happens to have multiple URLs.

To set up a goal in Google Analytics, start from the admin menu of your account (at the right of that big orange navigation bar). From the admin menu, select the goals tab.

Select the “+goal” link to add a new goal. The screen will look like this. Click the “URL goal” radio button option.

This will open up a set of options. Enter a goal name that specifically describes the ultimate goal of your funnel (e.g. “T-shirt sale”). Next check the box for “use funnel,” highlighted in the image below.


1. First, copy the URL of the ultimate page on your site where a user lands when completing the goal, such as a thank you page after completing a purchase. Insert that URL in the “Goal URL” box just below “Goal Details.” Include everything after the root of the domain, (e.g., and everything before a “?,” if there is one in your link.

Every time a user lands on this page, it counts as a goal conversion. By checking the “add funnel” check box and adding preliminary steps, you will see how those pages assist in each of these conversions so that you discover ways to get more of your site visitors to convert.

If this page also entails that you have earned a set amount of revenue, enter that amount under “goal value.” Then, for every conversion, Google will tabulate the amount of revenue you have earned; that way you can determine the ROI of your different campaigns.

While it can be helpful for goals that involve a set revenue amount, you don’t need to insert a goal value before you proceed.

The other default settings are usually fine.

2. Next, enter the URL (minus the part) for each step in the process. If the first step is required, check the required step box. As you type, Google will auto-suggest pages that you already have on your site. Click on one of them to be sure that your URL is typed correctly.

Enter descriptive names that tell you exactly what the user is doing on this page. This will make your funnel much easier to understand.

When your funnel is set up, click Save.

Now go to your standard reporting menu, and click on “Conversions” in the left navigation bar, then click “Goals” and finally “Funnel Visualization.” [See image below]

Here you can see a dropdown for all your funnels. Here are all your metrics for how many people have completed your checkout process.
If you already have site data for these pages, you will see the results. (This example is on a blank site).

How to Read the Funnel

As with everything in Google Analytics, green is good and red is bad. On the left, you will see numbers for who has entered each of your pages in the funnel process. On the right, you will see who has left your process. If they go to another page on your site, it will show up here as well.

In the arrows between each stage of the process, you see conversion rates for each page, indicating what percentage of the visitors to each of these pages continued to the next step in the process. If your percentage is low, this may indicate that you should test and optimize that page to increase the number of people moving on to the next page (and closer to conversion!). You may just make it easier or more compelling to get to the next step by improving your page’s content and user experience.

The great thing about setting up goals is that you can see how each of the standard metrics—traffic, visitors, content, etc.—contributes to each of your goals. This is where good business insights begin in Google Analytics.

MixPanel Event Tracking and Funnel Walkthrough

In MixPanel, you need to set up each event in your process before you can set up a funnel. Also, be sure to install the JavaScript library code into your site’s header template before the </head> tag (header.php in the editor menu, for WordPress users). The process is identical to setting up Google Analytics. Set up is very easy, and MixPanel will guide you through.

Next, you will need to set up the individual events you want to track within your funnel. To track events in MixPanel, insert this event tracking code between the </head> and <body> tags for each page you wish to track, and change the label inside the quotes (“Bought Tshirt” in this example) to describe the specific event you are tracking.

<script type="text/javascript">
mixpanel.track("Bought Tshirt")

On WordPress, you can do this in some of the template files, such as a singlepost.php template from the Appearance → Editor menu, but for individual pages, you can just insert the HTML code at the top of each page in the page editor, like this:

(In these scripts, you can also assign properties to segment your traffic, but it isn’t required. The MixPanel documentation will show you how, if you are interested.)

Now, quickly visit each page on your site that you are tracking on MixPanel. This should send an event to your MixPanel account. Now you’re cookin’.

Click the Funnels icon in the navigation bar.



When you create a new funnel, the screen will look like this:


Start typing in the name of each event (not the page URL, but the label you put in the event tracking code). A dropdown list will show you all the events that MixPanel has logged, indicating that you set up the tracking code correctly.

You can also set up segments, if available, but that is unnecessary.

Fill out every step in the process, in much the same way as Google Analytics, except that you can track some other events such as social shares if you want.

Then click Done.

Now in the Funnels panel, you can select each of your funnels in the upper left dropdown button and view a report that looks like the one below. These MixPanel reports provide really clean and simple data. Here you can see the results of A/B testing, if you had set it up already, which is a neat feature of MixPanel funnels.

Next Steps

Once you have a funnel in place, the real value of analytics will become apparent and you will wonder why you didn’t do it sooner!

Now that you can see your funnel, the goal is to soften the slope of the funnel by decreasing the rate of drop-offs at each step in the funnel. In other words, you want a higher percentage of people who enter the funnel to end up converting. Meanwhile, you will want to get more people to start the funnel by setting up campaigns (i.e., marketing), many of which can be tracked by Google Analytics.

Consider optimizing pages in your funnel, starting at the bottom of the funnel, closer to your goal, and then working your way backward. It is best to focus on one page at a time. Depending on the reports, you may want to test the page with an A/B split-test (optimization) and then tweak the page accordingly, or you may want to collapse the process and get rid of a page that seems to be hanging up the process.

Whatever you decide to do with these pages from now on, you will be able to see if it works due to your handy dandy funnel analysis.

When you have both goals/events and campaign tracking set up in your analytics accounts, you can begin to measure the effectiveness (ROI) of your Internet marketing efforts, and then all of this analytics stuff will stop seemingly like weird geeky stuff and more like awesome money-making insights.

That kind of insight is infinitely more valuable than any “traffic overview” or “page visit” counts that show up in standard analytics reports. If you aren’t doing a funnel analysis, especially if you have an ecommerce site, you aren’t cashing in on one of the greatest benefits of site analytics.