• Home
  • About
  • Piqq.us Invite Feed
  • Links
  • RSS CULT
  • Advanced Statistics Tracking for SEO, PPC, and Other Such Insanity

    Ok. Sorry for the lack of entries this week. I’m going to brainstorm some new ones that should be awesome for this week to make up for it. But today, we’re going to get into the nitty-gritty of tracking. Why? Because if you’re not tracking, you’re probably losing money.

    Why This Entry?
    Because I was a bit dissatisfied with the public tracking/logging systems out there. They were either not poweful enough, or too much hassle to set up. So on and off this week I’ve been coding my own, and thought I’d share some things that have worked out especially good for me.
    Beyond that, it’s something that really needs to be approached. Any kind of marketing or promotion online REALLY requires people to know what converts over.

    But I’m an SEO! We don’t need the same tracking as PPC people! Not needed.
    This is a misconception. Too many SEOs settle for Google analytics and just stare at what’s bringing traffic. But how much money and effort are you or your clients sinking into SEO? For a competitive niche, I’m willing to place a wager on the fact that it’s probably a lot. So if you’re ranking #10 for a medium-tail result, but that’s turning into 50% of your conversions, wouldn’t you want to know that fact so that you can take #1 for that spot? A lot of the “tails” end up converting better than their short tail brethren, so it’s definitely worth it to find these and promote for them.
    I understand it’s not technically even an SEO’s job to track conversions, and agree with that. But if you’re looking for a happy customer, this may be worth it. Also, knowing which keywords to go after ARE part of the SEO’s job. If the main short tail doesn’t convert at all, you may just save yourself some work.

    The Traits of Highly Effective Logging System

    1. Seperate SEO and PPC TrafficI will never understand why PPCers are willing to put so much effort into making a large scale site, but not any effort into getting organic traffic to it was well.
      • When traffic enters your site, SEO and PPC traffic are nearly indistinguishable from eachother. They have identical referrer structure. So how do we tell them apart? We set a variable that our logging system understands to differentiate between the two. For example, in my system, any PPC traffic starts with a variable (?src=0) that tells my logging system to drop a cookie on the user’s system with both a unique ID, and the fact that they’re from PPC traffic, not SEO. Seperating it out in the logs makes it much easier to track.
    2. Track Every Variable You Can (PPC)
      • For PPC, make sure when they enter your site you have as many variables as possible logged. What I log is PPC engine, campaign, adgroup, the actual ad they saw, and the keyword I bid on. Then when they enter the site, I extract out the query they actually searched for, and log that too (essential since I’m a big fan of phrase matching)
        An example url for this and step one might be mydomain.com?ad=3&adgroup=blue-widgets&keyword=buy+blue+widgets&campaign=widgets&engine=goog&src=0
        Of course, you should be able to look in your stats and see which of all of these are converting, and which aren’t.
    3. Track Each User Individually

      • Each user should have a cookie or other tracking variable on their system that can later be used to track conversions(inserted into SubID, or in a tracking pixel). This is much easier if you run the site 100% and are not doing an affiliate offer. If anyone here has used tracking202, think similar to that.
    4. Clean Your URL
      • Tracking is ugly in the URL. It looks unprofessional and nasty. The function I include below may not be the best way to do it, but it’s how I wrote it in a pinch. It is called after the data is logged and the cookie is dropped. Every variable in the removeArray is removed, so you can still have dynamic variables and whatnot, it just removes tracking variables. Do a header(“Location: “. cleanURL()); redirect to execute it.
        function cleanURL()
        {
        $newQString=”";
        $removeArray=array(“ad”,”adgroup”,”keyword”,”engine”,”src”,”campaign”);
        $queryString=$_SERVER['QUERY_STRING'];
        $spl=explode(“&”,$queryString);
        for($i=0; $i<sizeof($spl); $i++)
        {
        $spl2=explode(“=”, $spl[$i]);
        if(!in_array($spl2[0],$removeArray))
        {
        $newQString=$spl[$i].”&”.$newQString;
        }
        }
        $newQString=trim($newQString,”&”);
        $url=$_SERVER['HTTP_HOST'].”".$_SERVER['SCRIPT_NAME'].”?”.$newQString;
        return(“http://”.$url);
        }
    5. Automatically Identify the Worst Converting Queries
      Ok. So a lot of logging systems keep track of which keyword the user entered with and whether they converted with. But this is to be used with their actual query, not what they bidded on.
      After you load your conversions into the system(to be covered later), have it parse out each individual keyword or reoccuring phrase in those searches. Then check each one and see how it converts. You may find certain things (city names, “free”, “download”, etc) may not convert over as well on your end, and you can save some cash/effort by no longer optimizing for those keywords or by adding them to a negatives list.
    6. Tracking Conversions or Hang Time
      Ok, so if you’re selling a product, track conversions. If it’s informational, track how long the user idles on the site. We’ll cover conversion tracking right here.

      • For conversions, either insert the user’s unique ID(similar to tracking202 again) into the SUBID so they can be tracked later, or use a tracking pixel. A tracking pixel is essentially just an image that you can get included on the page the user sees after the purchases that informs your system that they converted. More on this in a later entry, as it’s something still in development on my end, and I don’t want to speak out of my arse.
    7. Tracking Hang Time
      So want to see how long the user stays on your site? Of course! If the users are all bouncing after 3 seconds, chances are you have a layout or “looking professional” problem. If they hang for a long time, then don’t click a purchase link, work on link visibility or copy on the site. There’s a few ways to do this, but this is the easiest(IMO)

      • Use the Javascript setTimeOut function to create and remove an image via document.createElement(), and addChild()/removeChild(). Include an argument in it that symbolizes how many times the image has been called already(so image.php?seconds=10). Have this image get created/removed every 10 seconds or so. The image(in reality) is a script.
        Execute your mysql immediately in the PHP to insert the fact that $_GET['seconds'] got called. Make sure you have a 1×1 image in the same directory as your script. After that, use header(“Content-type:image/jpeg”); echo file_get_contents(“./pixel.jpg”);.
        This will cause the PHP file to output as if it were a jpeg image, so you can log from it and not have it output a broken image error.
        A bit of a pain, but functional.
      • Alternately, you may be able to have an onLoad function that does what is described up there without the setTimeout and looping. Then have another onUnload call that alerts you when they leave. Although to be honest, I don’t trust onUnload.
    8. Be Able to Create Tracking Variables on The Fly
      • This is my biggest complaint about current tracking systems I’ve seen. I have to go in and explicitly create ads/adgroups and whatnot in their system, as well as adwords. Make it so it just accepts the given value(after cleaning it for injections, of course), and uses it.
    9. Break Conversions Down by Time/Region
      • Conversions are odd. Some products convert like fire between 2AM-8AM, and will drop off incredibly afterwards. Know where your users come from, and when they’re hitting the page.
    10. Track By Enterance Page (SEOers)
      • So while PPCers are lucky and can DECIDE which page users come in on, SEO? Not as lucky. They come to whatever page Google decided in it’s bizarre logic is the proper page. Watch each page, and which hits it’s getting, and how long those users stay/what they do. If you have one page getting a lot of hits, but almost no conversions, perhaps it’s time to step up your game on that page.

    But XMCP, Tracking Program ABC does all of this!
    There are a lot of stats tracking programs out there. But first, I like to be in complete control of how the tracking is done. I can change it, update it, and fix it in minutes.
    But beyond that, in terms of any decent amount of money, do you really want to trust whichever company runs the program with your data? I’m not saying that they access it, but I’m saying it’s something to consider. And if not them, hackers do exist, and get into things much more complicated/secure than a tracking system. Why steal credit card numbers when you can steal 100k+/month campaigns, and not have it be traceable?
    Really, I could go on for hours about this. But I think at this point most people will be able to follow the basic train of thought to come up with their own modifications on it.
    But yes, look forward to more entries this week. They’re coming. Consider yourself warned.

    -XMCP

    11 Responses to “Advanced Statistics Tracking for SEO, PPC, and Other Such Insanity”

    1. imnotsid says:

      Glad i’m not the only one that couldn’t find decent stats programs/scripts.
      It is a lot more handy to have your own script. Always adding small things and viewing (and collecting) the data exactly like i want it.

    2. Gabriel says:

      Nice Article!

      One question though: If you’re using phrase match in AdWords you can just get the phrase as keyword right? (Not the actual phrase) – or does this only count for broad?

      Like when bidding on “apple tree” the {keyword} variable always holds “apple tree” never “green apple tree” or any other phrase variants.

      Greets
      Gabriel

    3. Josh Testone says:

      Well Put… The only think I would add to this is come up with a list of ways you would want to view your data (reports) and make sure you code your system to be compatible with those needed reports. I cant tell you how many times I have wanted to view something a certain way and had to go back and add a field to a table, update queries/sql, etc.

      Happy coding!

    4. Tob says:

      This is great. I’ve done this in the past and had an almost automated system for cutting poorly performing keywords / adgroups.

      My beef here is, on the Google Content Network there isn’t an accurate way of tracking what urls your visitors are coming from – unless you parse it out of the referrer which is sketchy at best.

      Have you had any experience here or any thoughts?

    5. Eric B says:

      For PPC:
      For tracking purposes, get a domain you’ll use only for that. Just one of those cheap .info ones since no one will see it. Put that for your destination URL in adwords and then have it redirect to your real site.

      So, http://tracker.info/?blah=blah&blah=keyword&blah=whatever else&a=10

      Create a little front end so you can add landing pages easily and quickly. Then store each visit in a DB and pass just the visit id to your landing page so it can reference it. So, http://landingpage.com/?v=visit_id

      Then on the landing page you can look up the info you stored from the tracking page for that visitor, and then pass that visit_id along as a subid. Now, you know exactly how that specific visitor got to your page and what they ended up doing.

    6. Google Search Sucks says:

      Great point, the analytics that exist today are very limited. Problem is many of use don’t have the skill to create our own analytics.

      You should create something out of hte box, I would wager there would be many people who would pay for the code/service.

    7. Justin Rumpf says:

      I posted a Free Keyword tracking program I built in asp.net if anyone would like to download. I think it tracks most things listed here, but may need some

    8. Ryan Kauffman says:

      … hackers do exist, and get into things much more complicated/secure than a tracking system. Why steal credit card numbers when you can steal 100k+/month campaigns, and not have it be traceable?

      novel idea… :-x

    9. John says:

      We’ve been working on an in-house solution, on and off for around a year now. Just saw this yesterday though: http://piwik.org. Its an open source analytics tool.

    10. RMD says:

      Just wanted to ditto John’s mention of Piwik: a viable, graphic alternative to GA or AWStats. Campaign/partner tracking, customize dashboard, API calls, works with OpenAds + a ton more. It’s not perfect, but it’s getting there.

    11. Andy says:

      ?Shady,

      thanks for posting this.

      I’ve been coding my own various marketing scripts this year and was thinking about a centralized affiliate link redirect/tracking script when I realized it is good to hide as much info as possible from the final destination site.

      The metrics that you listed go beyond what I was thinking of so I got some ideas for future things to add i.e. the timing related metrics.

      I like your idea for the on-the-fly tracking variables without having to login and set things up.

      Just getting into the idea of using PPC and wanting to start out winning rather than spending a lot of money learning from mistakes.

    Leave a Reply

    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Marketing & SEO Blogs - Blog Top Sites
    © Slightly Shady SEO, All Rights Reserved. Scrape me, and I will eat your soul.