Call us Toll-Free:
Email us

Tracking Retention in Google Analytics

Mike Peters, January 29, 2013
Tracking retention rates or cohort analysis, is the best way to visualize your site's addict-ability.

User retention tends to be an area where people pay the least amount of attention, but I think is one of the most important to monitor. I would argue that the single most telling metric for a great product is how many of them become dedicated, repeat users.

If you fail to retain users over time, traffic will never generate a "snow ball" effect. Your glass-ceiling becomes limited to the arbitrage difference between the cost of traffic and ad revenues.

Focus on continually improving your retention rates and you'll be well on your way to building a mega successful site.

First step is to monitor your retention rate numbers. As they say - "What doesn't get measured, Doesn't get done".

The goal is to have the data you need to generate a cohort report like this one:

In this post, I'll describe how to use Google Analytics, for cohort analysis.

Don't be fooled by Google's Returning visitors numbers

Google Analytics appears to provide information about visitor retention through the New vs. Returning visitors report.

That report shows you the proportion of returning visitors. You could set your date range for January, note the percentage of returning visitors, and then set the date range for February, hoping that the percentage of returning visitors has increased.

But what happens if you retain all your January visitors, but drive a ton of new visitors to the site in February? Your proportion of returning-to-new visitors will go down even though you're retaining visitors!

Additionally, if your funnel involves users leaving the site (to "Facebook-Connect" for example), Google Analytics could confuse that with a user leaving the site.

Tagging visitors

For proper cohort analysis, we need a way to "tag" users, segmenting them into groups based on the date of first visit.

We'll then be able to look at the group of new users generated on a given month and see how long they stuck around:

Google Analytics custom variables and events, lets us put it all together.

Step 1 - Install Google Analytics

Signup for Google Analytics (it's free) and create an account for your site.

Add the Google Analytics code to all pages on your site.

Generally this means adding the code to your footer include file.

Step 2 - Pulse script

Save this script under the root folder of your site:


header('Content-type: application/json');

"if(typeof pulseCallback=='function')".
' pulseCallback({"pulse":"'.date('Y-m-d').'"});');

Note that I'm assuming your server supports PHP. If you're using a different server-side scripting language, find a geek who can help or contact us.

Step 3 - Store custom variable in Google Analytics

Add this javascript code to the footer of all pages:
function jsCreateCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString()}else var expires="";document.cookie=name+"="+value+expires+"; path=/"}
function jsReadCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i!=ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length)}return null}
function jsGetCookie(cvar, cval) { if (cval == undefined) cval = ''; return (jsReadCookie(cvar) != null && jsReadCookie(cvar) != '') ? jsReadCookie(cvar) : cval; }

try {
var checkpulse = jsGetCookie('checkpulse');
if (!checkpulse) {
// get timestamp
var s = document.createElement('script'); s.type = 'text/javascript'; s.src = ''; s.async = true;
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(s);
} else {
channel = ""; // Update when using channels
$(document).ready(function () { _gaq.push(['_trackEvent', 'Pulse', checkpulse, 'Channel #'+channel]); });
} catch(err){}
function pulseCallback(o) {
jsCreateCookie('checkpulse', o.pulse, 365);

What we're doing here is - on every page load, check if the user was already tagged with a "create date".

If user not tagged yet - it's a new user, we connect to the server's pulse.php script and fetch today's date. The date is then stored in a local cookie named "checkpulse".

Finally, we pass the event to Google Analytics, incrementing a count for our user's "create date".

Crunching the numbers

Congratulations! Now you can finally track your real retention rates and build a cohort chart.

Login to Google Analytics, open "Traffic Sources", then "Events" - "Top Events"

Select the date range starting with the first month you're tracking (January in the example above) through today. Change the period to "Month" and select "Unique Events":

Hover above the chart and record the numbers for each of the months

Download sample Cohort report and populate it with your data. Pay attention to your user's average life time and variations in month-to-month retention rates.

Know your numbers.

Use your cohort report as a compass for whether or not you've created a great product that users love.

New: Real-time Path To Conversion

Adrian Singer, May 14, 2009
SPI is proud to announce the official release of a much anticipated feature - Live Real-time Path To Conversion

It's a powerful new way to look at your online business, that was never available before.

See exactly how customers and prospects are interacting with your website in real time, understand where conversions are coming from and track end-user activities across all channels.

How does it work?

We've always offered the ability to view real time dashboards, giving you a 360 degree view of your online business.

When you login to your SPI account, you are immediately presented with a dashboard showing Order stats, Website traffic, Lead signup rates, Affiliate performance and more:

The new Path To Conversion feature takes this one step further, by tagging all visitors to your website and allowing you to view what these users are doing in real time.

This works whether your users have their cookies on or not.


Unlike other solutions, SPI Path To Conversion covers all channels (Email Marketing, PPC, Shopping Cart, Media and Offline campaigns)

= PPC Path to conversion:

= Email Marketing Path to conversion:

= Shopping Cart Live feed:



Where to get it

Contact your SPI Account Manager for instructions on how to enable this feature in your account.

Average ROI per Marketing Channel breakdown

Adrian Singer, October 16, 2008
SoftwareProjects is a full-service Internet Marketing & Web development firm, supporting 3,000 businesses in 14 countries.

With $600M of Internet Marketing budgets under management and $1 billion in orders going through our shopping cart system, we learned a thing or two about what type of marketing works best for each industry.

Over the last few days, we dug deep into our analytics to come up with aggregate data that would answer two very popular questions we get asked a lot -

1. "What type of ROI can I expect on my marketing dollars?"

2. "Which marketing channels should I target? How should I divide my budget across the different channels?"

When I volunteered for this project, I didn't realize the amount of work that would go into dissecting the analytics for about 2,400 companies we had data for.

We service a variety of different industries and every industry is unique. I quickly decided to focus on 4 popular industries and began crunching the numbers, with the help of an engineer.

Without further ado, I'm proud to present to you the results of our findings -

Distribution of Marketing budget by Industry

Average ROI by Industry

* We highlighted the top channels for each industry in yellow.
* ROI of 100% is break-even. ROI of 3% means the company generated a 3% return on its marketing dollars, losing 97% of its investment.

View 8 Comment(s)

Shopping Cart Net Sales Report

Adrian Singer, August 22, 2008
When you sell anything online, it is very important that you know your numbers.

Most folks know their gross sales (total $ collected in sales), but what about the more important numbers?

SoftwareProjects Shopping Cart Net Sales Report shows a breakdown of:

* Gross sales,
* Commissions,
* Refunds and
* Net sales (Gross sales - Commissions - Refunds)

...over a selected time frame:

Focusing on net sales and always keeping your net sales line above zero, is the only way to turn a real profit.

PPC Management: Track Everything

Adrian Singer, July 31, 2008
Can your PPC Management platform do this?

What about this?

If not, now may be a good time to switch.

If you're not tracking conversion rate, EPC, CPA and ROI on a per keyword level, you're leaving a lot of money on the table.

My Optin rate is weird

Adrian Singer, July 25, 2008
Just got this email from an Information Marketing guru:


Subject: My Optin rate is weird

Here's what I see over the last couple of days:

Monday - 19% opt-in rate
Tuesday - 21%
Wednesday - 21%
Thursday - 16%
Friday (today) - 7%

I have not changed anything since Tuesday so it's not the text, the form or anything else that I handle. Obviously, it's unlikely that the traffic shifted so much that the opt-in rate dropped from 21% to 7%.

So what else is it? Any ideas?


The problem with looking at global day-by-day stats is that the numbers can be very misleading.

When it comes to tracking, you want to have as much granularity as possible. You want to track -everything-

If you're not tracking everything, the numbers don't mean much.

Consider the example below. A screenshot from Software Projects Affiliate Management system that shows a breakdown of sales, signups, conversions and cancellations, by affiliate, for one of our clients:

Do you see that last affiliate on the list?

His traffic is really lousy. 0.23% conversion rate and 72% cancellation rate! Yikes

Whenever this affiliate is doing a promotion, the daily conversion rate and opt-in rate greatly suffers.

That's why you should be tracking everything. A few pointers:

1. Track everything on an hourly basis. Day by day is misleading

2. Always look at the last 30 days and the same month of last year (if you have it), when comparing numbers

3. When tracking optins and conversions, track by source. You don't want to mingle the results of affiliate1 / affiliate2 or emailcampaign1 / emailcampaign2.

PPC Management: Measuring ROI

Adrian Singer, November 19, 2007
Making money with PPC is easy (!) as long as you understand the basic math involved.

There is a three letter acronym you might have heard about, that is "the secret" of all PPC millionaires.

It's called ROI and it stands for Return On Investment.

If you spend $100 to make a $200 profit, your ROI is 2 to 1.

PPC success is achieved by simply measuring your ROI and continually taking the necessary steps to improve it.

Measuring your ROI

I am always surprised at how many companies out there, spend thousands of dollars on Pay Per Click marketing, without taking 5 minutes to setup a way to measure their ROI.

If you're not tracking your conversions, you shouldn't be doing PPC to begin with.

Remember the quote above about PPC success? If you don't know your ROI on a per product/keyword level, you'll never be able to take the necessary steps to improve it.

In order to measure your ROI you have to do two things.

First, you need to Install Google's Conversion tracker on your shopping-cart "thank you" page. You will have to pass the total amount of the purchase to Google's conversion tracker.

Second, you need a system (basic spreadsheet would do) where you list your cost of sales per every offer you are promoting. Cost of sales is defined as "The cost of goods sold plus any expenses incurred in the selling and delivery of the product or service.".

It is super important for you to know your true cost of sales, because it is part of the ROI formula.

Once you have everything, you should be able to look at a PPC campaign that looks like this:

and calculate the ROI for every single product.

Before you go any further, look at the chart above and try to guess which of the two products is more profitable? Is it the first one or the second one?

Take your pick......... Now.


Without ROI data, all you can do is guess. Now let me show you why ROI data is so valuable.

For the purpose of this example, let's assume -

* Product A (first row) sells for $23 a pop and costs us $6 per sale.
* Product B (second row) is an affiliate offer that pays $48.84 a sale and costs us a flat $20 (paying a copywriter once a week to tweak the copy).

Applying the "cost of sales" to the chart above, yields:

== Product A ==

Total conversions = 60;
Gross Sales = 60 * $23 = $1,380.00
Cost of advertising = $1,256.31

Gross sales - Cost of advertising = $123.69

Seems like we have a $123.69 profit, rght?


Cost of sales = 60 * $6 = $360
Product A ROI = (Gross sales) - (Cost of PPC) - (Cost of sales) = -$236.31

== Product B ==

Total conversions = 50
Gross Sales = 50 * $48.84 = $2,442
Cost of advertising = $2,379.25

Gross Sales - Cost of advertising = $62.75

Without applying the Cost of sales, it would seem like Product A has a better return on our investment and we should continue pushing it.

Once you apply the cost of sales to the formula, you can see the ROI for Product is positive, while Product A is losing money.

Cost of Sales = $20
Product B ROI = (Gross sales) - (Cost of PPC) - (Cost of sales) = $42.75


In conclusion,

Google's reported Cost-Per-Acquisition is deceiving. Make sure you always focus on ROI, not CPA.

Oh, and if you're an affiliate promoting an offer where they don't allow you to install your conversion-tracker on the "thank you" page, do yourself a favor and skip that offer.
« Previous Posts

About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions