Cookies: Every Online Marketer’s Guilty Pleasure

Every online marketer should understand cookies. No, I’m not talking about the kind that come out of the oven warm and gooey and go great with milk. I’m talking about the web cookie, also known as a browser cookie or HTTP cookie.


A cookie is a piece of text stored on a user’s computer by their web browser. A cookie can be used for authentication, storing site preferences, shopping cart contents, the identifier for a server-based session, or anything else that can be accomplished through storing text data.


Good question – while cookies are mainly used in the world of web development and programming, they can be an extremely powerful tool for an online marketer. As an online marketer we mainly have two jobs: generate leads and qualify leads so that sales can follow-up on the “hot” leads first while allowing marketing to nurture the not-so-hot leads further. Cookies can’t help with generating leads, but they certainly can help with qualifying leads by helping to streamline the process of gathering more information on your prospects.


Absolutely. Let me walk you through a recent example…

At the company I work at we do a lot of online webinars through either GoToMeeting or WebEx. As you probably know, when you create a webinar in either of these services they automatically create a registration page for you that is hosted on their servers. Typically, you will just promote the registration page that is hosted on either or, and call it a day. This is actually a HUGE mistake. Here’s why…

By sending all your traffic to GoToMeeting or WebEx, you miss a PRIME opportunity to drop a cookie on your prospects computer. You should be creating a registration form on YOUR website that when a user registers, it drops a cookie. Why is it important to drop a cookie? Because as soon as you can collect a user’s information (through the registration page) and drop a cookie on their computer, you will be able to track things like when a prospects comes back to your website, what pages on your website a prospect viewed, how many pages on your website a prospect viewed, etc. This type of information is hugely important for qualifying a prospect.


Here is another example of a creative way to use cookies to qualify prospects… Above I talked about how we now have everyone register for webinars through our own website in order to drop a cookie on their machine. We decided to take this idea one step further. When a prospect registers for a webinar, we now send them to a short survey that is positioned in a way that asks for what they would like to learn on the webinar. The key to this survey is that it appears to be anonymous to the prospect, but in reality we are able to match up the prospects survey responses and map it back to their lead information in Salesforce.

This short survey typically asks two questions that are optional:

  1. What would you like to learn from the webinar?
  2. What specific questions would you like to see addressed on the webinar?

We then will put 3-4 additional questions that are required and help us qualify the lead. Here are a couple of examples, but not the questions that we ask:

  1. How many employees are at your organization?
  2. Do you have budget for [enter your product/service]?
  3. What other products/services are you currently evaluating?
  4. Etc.

Our last webinar had over 350 people register, and using this method we were able to capture ALL the lead qualifying information we needed on 71.2% of the registrants. This allowed our sales team to immediately follow-up on the leads that were PERFECT fits for our product and had budgeted projects. Also, by knowing exactly what the prospected wanted to learn and what questions they had we were able to arm our sales team with valuable information that allowed them to tailor their conversations and address the prospect’s concerns/pain-points.


Yes we do. We currently use HubSpot with Salesforce integration. All the lead capture and webinar registration pages on our website are HubSpot web forms. As soon as someone lands on our website, HubSpot will drop a cookie. This cookie will then collect information while that person is browsing our website. As soon the visitor completes a HubSpot web form, we then become aware of that person’s identity and all their contact information is synced up to Salesforce where the sales team can then get access to it. Through HubSpot, the sales team is also aware of which pages the visitor has viewed, how many pages they have viewed, and when the visitor returns to the website.

Was this post clear? I’d love to get your feedback…

How to do usability testing of your website for cheap

Usability TestingToday I came across a great idea from Dan Shapiro on how he does usability testing for his website called SparkBuy. If you are a web developer, you know that usability of your website is one of the most important aspects in converting a visitor into a subscriber/member/customer. You only have a few seconds for that visitor to truly understand what your website does and what value you provide to them before they click the “back” button and you lose them forever.


There are many usability testing tools out there today that allow you to see how a visitor is interacting on your website. A couple interesting, but expensive, services include ClickTale and ClickTale records the mouse movements of actual visitors on your website and then aggregates all the data to give you interesting statistics. If you are a subscriber of ClickTale, you can actually login and watch recordings of every Internet Explorer and Firefox visitor that has come to your website. ClickTale is an awesome technology, but the service starts at $99/mo for the cheapest package. Also, since visitors being recorded by ClickTale don’t actually know they are being recorded, there is not audio or feedback from the actual visitors.

UserTesting.comThe other interesting service in the usability testing space is is a service where you pay $39 for a video recording of someone actually browsing your site and the user talks through what they see and experience as they are on your website. The one downside to using a service like is that the users viewing your site may not be your typical user as these are people who are getting paid to provide this service, therefore there opinion can be bias.


screencast-o-maticThe innovation solution that Dan Shapiro outlines is using a service called Their basic version is FREE and their premium plan is a whopping $9/yr – yes, that is $9 per year, not month. Using this service you can then go out and recruit usability testers. Where can you find usability testers for cheap? Amazon’s Mechanical Turk. On Mechanical Turk, you should be able to find people willing to do a quick usability test of your website and record their screen and voice using screencast-o-matic, all for as cheap as $2-$5 per recording. Now how is that for cheap usability testing!

How to parse Google Analytics cookie to track lead source

In my previous post titled “Lead source analytics every start-up should track,” I promised to write a follow-up post that outlines how to track the following lead source details…

  • Medium (organic, PPC, referral, email, webinar, press release, etc)
  • Lead Source (Google, Yahoo, Twitter, Facebook, LinkedIn, etc)
  • Keywords (What keywords did the visitor search?)
  • Referring URL (Where did the visitor come from?)
  • Landing Page (What was the first page the visitor visited on our website?)
  • Form URL (What was the URL of the form that the user filled out where you collected this information?)

We will use a combination of techniques including parsing the cookie set by Google Analytics to save these lead source details into PHP variables. We’ll then be able to pass these variables into our lead capture forms as hidden fields, so that when a lead registers on our website or fills out any type of form, we’ll be able to track these lead source details.

Let’s get started…

First, I’m going to give you the code. This code should be included in the header of every page of your website. Hopefully your website has one PHP file that makes up the header of every page of your website. This file is usually called header.php. If you have this file, you can dump this code right into that file.

$domain = $_SERVER['SERVER_NAME'];
$domain = "." . ltrim($domain,"www.");

$info = $_COOKIE['__utmz'];
// Get rid of id stuff
$holder = split("u", $info, 2);
$string = "u" . $holder[1];
// Parse String
$ga_vars = split("|", $string);
foreach ($ga_vars as $var) {
list($key,$value) = split("=",$var);
if ($key == "utmcmd") { setcookie("Medium", $value, time()+100000000, "/", $domain); $medium = $value; }
if ($key == "utmctr") { setcookie("Keywords", $value, time()+100000000, "/", $domain); $keywords = $value; }
if ($key == "utmcsr") { setcookie("GAsource", $value, time()+100000000, "/", $domain); $gasource = $value; }

if (!isset($_COOKIE['Referer'])) {
setcookie("Referer", $_SERVER[‘HTTP_REFERER’], time()+10000000, "/", $domain);
$referurl = $_SERVER['HTTP_REFERER'];
} else { $referurl = $_COOKIE['Referer']; }

$formurl = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

if (!isset($_COOKIE['LandingPage'])) {
setcookie("LandingPage", "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'], time()+10000000, "/", $domain);
$landingpage = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
} else { $landingpage = $_COOKIE['LandingPage']; }

Here is a description of each variable and how they are tracked and saved…


Medium is parsed from the Google Analytics cookie. You will need to have Google Analytics installed on every page of your website in order for this to be tracked. When a visitor comes to your website, Google will drop a cookie that contains important information about that visitor. One of the variables saved in this cookie is Medium, so we parse the Google Analytics cookie and save the Medium into a variable called $medium.

Lead Source

Lead Source is also parsed from the Google Analytics cookie just like Medium. It is saved into a variable called $gasource.


Keywords are also parsed from the Google Analytics cookie. This variable will not always be set, but if the visitor comes to your website via a search engine, it will record which keywords they used to visit your website. This variable works with all the major search engines – not just Google.

Referring URL

This code records the URL that the visitor clicked through to your website with. The code saves the Referring URL in a cookie, so the original Referring URL is preserved. It is saved into a variable called $referurl.

Landing Page

This is the first page that the visitor visits on your website. Like the Referring URL, a cookie is also used to save this URL so that it is preserved. It is saved into a variable called $landingpage.

Form URL

This is the URL of the page that the visitor finally is on when they fill out the lead capture form. This variable will update as the visitor navigates your website. A cookie is not used. It is saved into a variable called $formurl.

That pretty much sums up the script. In another follow-up post, I will write about how to pass these variables into a form as a hidden field and save it into your database. Look for this post shortly…

Lead source analytics every start-up should track

An area of marketing that I have been spending a considerable time studying recently is website analytics. I’ve been asking myself questions like:

  • What information should we be tracking?
  • What information is important to marketing?
  • What information is important to sales?
  • What information is important to executive management?
  • How do we track this information?
  • How do we present this information to marketing/sales in a way that it can easily become actionable?
  • How do we tie all our systems together (SalesForce, HubSpot, ClickTale, etc)?
  • How to we lead nurture and lead score?
  • When should a lead transition from marketing to sales?

This isn’t an easy problem to solve, especially for start-ups with limited resources and tight budgets. However, I would argue that properly tracking leads or new member activity is probably one of the most important things any start-up can do. The information and insight obtained through analytics will answer many questions like:

  • Where are new members/leads coming from?
  • What is my cost per lead? cost per new member? cost per sale? total lifetime value of a customer?
  • Where should I be allocating more advertising dollars? less advertising dollars?
  • What part of my website is converting? not converting?
  • Are social media leads more profitable than webinar leads?
  • For those leads that turned into sales, what common traits/activities do they possess?
  • How do I nurture and educate a lead so they are ready to buy?

Those are just some of the questions you’ll be able to answer and then act on. If you are a start-up that has received VC money, these are the exact questions your board of directors and investors will be asking. They will be very impressed if you can give clear, reliable answers to their questions.

So with that said, where/how do we begin?

I have identified the following lead source details that every start-up should be tracking today (this is just a start). In a follow-up post, I will include a detailed step-by-step description on how to properly track this information. Here are the lead source details:

  1. Medium (organic, PPC, referral, email, webinar, press release, etc)
  2. Lead Source (Google, Yahoo, Twitter, Facebook, LinkedIn, etc)
  3. Keywords (What keywords did the visitor search?)
  4. Referring URL (Where did the visitor come from?)
  5. Landing Page (What was the first page the visitor visited on our website?)
  6. Form URL (What was the URL of the form that the user filled out where you collected this information?)

Keep your eye out for my follow-up post on how to track all of the above web analytics and lead source details.