fbpx

Landing Pages have a tendency of getting long, in fact many say long landing pages see higher conversion rates. Scrolling one-page sites like Cadillac ATS vs. The World and The Story of Jess and Russ are becoming more and more common on the internet. With both kinds of pages user tracking becomes more difficult and more important. Recently, I was confronted with the problem when I developed my new website and I set off to better track my users using Google Analytics. I utilized old favorites like Event Tracking while coming up with unorthodox ways to section my site and track visitors.

Page Sectioning

By tracking visitor behavior in individual sections of a page you can gain knowledge about what content your visitors find most engaging and what content they skip over. We’ve found the best way to track highly distinct sections in Analytics is to treat them as separate pages, however, this requires using an undocumented method of the Google Analytics tracking code. The code below demonstrates tracking a “pageview” for an About section with an id of about-section.

$(window).scroll(function () {
    var scrollTop = $(window).scrollTop();

    $section = $("#about-section");
    var sectionTop = $section.offset().top;

    if(scrollTop > sectionTop && scrollTop < sectionTop + $section.height()){
        var pageName = "About";
        _gaq.push(['_set','page',document.location.pathname + pageName]);
        _gaq.push(['_trackPageview']);
    }
});

By tracking sections as individual pages you can get more precise tracking about visitor behavior on each section. Metrics like Time on Page mean more, event tracking and other actions can be better segmented.

Caveat: This is only useful if you have long highly distinct sections. Otherwise you’ll mess up your profile’s site metrics and not get a lot out of it.

Event Tracking

We at Ethoseo are of the firm belief that every page should feature event tracking, because without it you’re missing out on key user behavior and micro-conversions, this belief led us to develop Track Everything. But you don’t need to use our plugin to get the benefits of event tracking. All you need to do is track behavior using Google Analytics event tracking. Any action the user does that doesn’t lead to a new page should be tracked. Often times this means email signups and file downloads. To track these events, you’ll need a little javascript knowledge, for example to add tracking to an email signup, you’d want to add some code to your page that looks like this: (again, the code assumes you have jQuery loaded on the page)

$("#email-newsletter").on("submit", function (){
    _gaq.push(['trackEvent', 'Forms','Signup', 'Newsletter']);
});

Other behaviors we usually track include clicks on emails and outbound links. You can do this by default by adding the following code to the page: (again assuming you have jQuery installed)

$.expr[':'].external = function(obj){return !obj.href.match(/^mailto:/) && !obj.href.match(/^#:/) && (obj.hostname.replace(/^www\./i, '') != document.location.hostname.replace(/^www\./i, ''));};
$("a:external").on("click keypress", function (e) {
    _gaq.push(['_trackEvent', 'Link', 'Outbound', $(this).attr("href"), null, true]);
});
$('a[href^="mailto:"]').on("click keypress", function (e) {
    _gaq.push(['_trackEvent', 'Link', 'Email', $(this).attr("href").substring(7), null, true]);
});

Conclusions

Tracking user behavior on pages is essential, and with long pages, there’s more user behavior to track. By using these suggestions and typical Google Analytics features, like goals and segmentation, you’ll be able to more precisely track users on your page and be better able to make things they like.


Find this interesting? Want to hear more? Follow @ethoseo on Twitter.

Need help implementing the tracking described in this post? Check out our Google Analytics Services or get in touch.