dannytalk ™ A Danny Ng Blog

Danny Ng blogs about SEO, Web Development, Christianity, and Life in General

Goal & Funnel Setup Guide in Google Analytics

Posted by danny On May - 26 - 2009

Working in a Google Analytics Authorised Consultants (GAAC) accredited company and also having a Google Analytics Individual Qualification (GAIQ), it is essential that I master the art of setting up goals and funnels in Google Analytics for our clients.

A goal can be a very important metric for a client to track such as sales, newsletter sign-ups, and registrations. Of course goals are not just limited to those but can be extended to whatever you would define as an important action on the website to track. Not only is tracking important, but it is also vital that you gain insight into what’s going on in the goal process from funnels.

goal-graph

A funnel is a visual representation of what’s happening during each step of your goal. It gives you great insights into the drop off rates of each step so that you can make informed decisions on improving your goal process and landing pages to increase conversion rates. You can accurately pinpoint which step of the goal process are you getting high drop off rates.

This can help you identify problems such as the checkout button not working, too many call to actions that lead to other goals, not best practice usability and so on.
Read the rest of this entry »

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png

First of all, let me explain why in Google Analytics you need to do some configurations to track sub-domains / cross-domains.

Google Analytics does not do this by default, thus whenever you’re on sub1.domain.com and you go to sub2.domain.com, Google Analytics will record this as a referral rather than maintaining the same session and the same campaign information. If you’re running e-commerce tracking and you use sub-domains during the e-commerce process, this will totally screw up your reports as it will attribute all transactions to referrals (from your own site) and you will have no idea how your other online marketing campaigns (i.e. direct, organic, cpc) are performing.

Sub-Domain Tracking

This one is fairly easy. The method you need to use is _setDomainName().

Google utma cookie

The _setDomainName() method sets the Google cookies to the domain name string parameter that it is given, otherwise it automatically resolves the domain name from the location object in the DOM if no parameter is given. This means that on sub-domains, the cookies will be set to separate sub-domains.

So to configure Google Analytics to set the cookies to the same domain name, simply use the domain name as the string parameter for the _setDomainName() method.

E.g. If I have a website called sub1.dannytalk.com and sub2.dannytalk.com, I would use _setDomainName(‘dannytalk.com’) throughout all my pages (sub-domains and main domain).

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-xxxxxx-x"); // replace this with your own account number
pageTracker._setDomainName("dannytalk.com");
pageTracker._trackPageview();
</script>

The Google API officially states to use the period at the start of the domain name. I have tried with and without and it seems to work fine but I prefer without period (looks nicer).

Once you’ve done this, Google Analytics should record all visits to these sub-domains as the same visit, maintaining the same campaign information. However, in your reports,you won’t be able to tell which request URI came from which sub-domain as the domain name is stripped out from the reports.

In addition, if you have two sub-domains that have the same page name (i.e. index.html), then Google Analytics will combine these two into one which will artificially inflate your page statistics.

A simple way around this is to implement what I call a sub-domain visibility filter which will prefix your request URI’s with the domain name. This will help you differentiate the pages as well as avoid inflating the page statistics.

Read the rest of this entry »

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png

How to 301 redirect from Blogger to WordPress

Posted by danny On July - 26 - 2008

As promised in my previous post (301 Meta Refresh Redirects: How Google and Yahoo Sees It), I will show you a script I wrote that will handle 301 redirects from Blogger to WordPress using the meta refresh tag and javascript.

I have tested it on my old blogger (http://dannynsl.blogspot.com) and it seems to have worked fine so far.

There are a few steps you will first need to do.

  1. Install WordPress on your domain. There should be installation tutorials on the website. I haven’t had time yet to do my own installation tutorial.
  2. Import your Blogger posts into WordPress. In your dashboard, go to Manage and then Import.
    WordPress - Import Blogger
  3. Change your permalink structure. In your dashboard, go to Settings and then Permalinks. The Day and name or Month and name settings should work. However, for my script I think Month and name should be safer.
    WordPress - Permalinks Settings
  4. Use my javascript code just after the start of the <head> tag in your Blogger layout template. Note: Please make sure you do a backup before making changes. The variables that you need to change are old_root_domain and new_root_domain. This script handles redirection of individual posts, monthly archives and yearly archives. Anything else it will redirect to your homepage.

    When assigning values to old_root_domain and new_root_domain, DO NOT use ‘/’ at the end.

<script type='text/javascript'>
/*
 * Written by Danny Ng (http://www.dannytalk.com/2008/07/26/how-to-301-redirect-from-blogger-to-wordpress/)
 * Free to use and distribute but must keep this comment in place.
 */
var post_regex = /^http:\/\/(www.)?.*\.blogspot\.com\/\d{4}\/\d{2}\//;
var month_archive_regex = /http:\/\/(www.)?.*\.blogspot\.com\/\d{4}_\d{2}_\d{2}_archive.html/;
var year_archive_regex = /updated-min=\d{4}/;
var label_regex = /search\/label\/.+/;
var old_root_domain = 'http://dannynsl.blogspot.com', new_root_domain = 'http://www.dannytalk.com', tag_url = '/tag/', redirect_suffix;

if (post_regex.test(location.href))
	redirect_suffix = (location.href.search(/www/i) == 7) ? location.href.substring(old_root_domain.length+4, location.href.length-5) : location.href.substring(old_root_domain.length, location.href.length-5); // -5 to strip .html
else if (month_archive_regex.test(location.href))
{
	redirect_suffix = (location.href.search(/www/i) == 7) ? location.href.substring(old_root_domain.length+4, location.href.length-16) : location.href.substring(old_root_domain.length, location.href.length-16); // -16 to strip _XX_archive.html
	redirect_suffix = redirect_suffix.replace(/_/g, '/');
}
else if (year_archive_regex.test(location.href))
{
	redirect_suffix = year_archive_regex.exec(location.href).toString();
	redirect_suffix = redirect_suffix.replace(/updated-min=/, '/');
}
else if (label_regex.test(location.href))
{
	redirect_suffix = label_regex.exec(location.href).toString();
	redirect_suffix = tag_url + redirect_suffix.split('/')[2];
}
else
	redirect_suffix = '';

document.write("<meta content='0;URL=" + new_root_domain + redirect_suffix + "' http-equiv='refresh'/>");
</script>

If you want to do a 302 redirect equivalent, just change the number in the meta content from 0 to 1 or 2.

Hope this works for you and please let me know if there are any bug issues.

[edit date=26/07/08]

I just fixed the code to accommodate blog addresses with ‘www’ subdomains. As for redirects for labels, I’ll try to update the code for it tomorrow if I have time.

[/edit]

[edit date=27/07/08]

I’ve added a new regular expression to handle labels and also another variable tag_url that points to your permalink structure for tags or categories.

WordPress - Category, Tag edit

This setting can be found under Setting, then Permalinks and just scroll right down to the bottom. You will need to edit the variable tag_url to what you’ve sent in the permalinks structure. Make sure you add the ‘/’ at the end of it.

I think by default, WordPress automatically imports posts from Blogger and sets the labels to categories instead of tags. In this case, just set the variable to the category slug name unless you can be bothered to go through all the posts and set them as tags instead.

[/edit]

[edit date=14/02/08]

Just found a bug (thanks to Chris Lee) that the redirection didn’t seem to work in IE7. For some reason I needed to add URL= in the meta content attribute for the redirection to work.

Basically I just changed,

document.write(“<meta content=’0;” + new_root_domain + redirect_suffix + “‘ http-equiv=’refresh’/>”);

to

document.write(“<meta content=’0;URL=” + new_root_domain + redirect_suffix + “‘ http-equiv=’refresh’/>”);

Please let me know if you guys ever come across bugs for this script and I will try my best to fix it as soon as possible :)

Happy Valentines Day everyone!

[/edit]

Bookmark This!

http://www.dannytalk.com/wp-content/plugins/sociofluid/images/digg_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/reddit_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/delicious_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/furl_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/newsvine_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/technorati_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/google_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/myspace_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/facebook_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/sphinn_48.png http://www.dannytalk.com/wp-content/plugins/sociofluid/images/twitter_48.png