Friday, June 13, 2014

Setting Up Goals in Google Analytics

Google Analytics is an advanced tool which helps in utilizing your website in the best possible (optimal) way. It gives you concrete information, based on numbers, which can be used for further improvement of the websites. One of its features which help in this task is of tracking the conversion which helps in optimizing it so that the traffic can be made to convert fast and at a better rate. In order to set up this tracking, you also need to be completely knowledgeable about creation of goals, funnels and channels for detecting the flow in which the visitors trend on the site and then move on to analyze reports for this behavior.
The first step of setting up Goals in Google Analytics is described here:
Goals are the purposes which you expect your website to serve. You can find Goals by logging in to your analytics account --admin-- View-- Goals.

Types of Goals

Google Analytics gives you the option of choosing from among the four pre-defined types of goals. These are: Destination, Duration, Pages/Screens per session or Event. Destination is the page which you expect visitors to reach so as to assume that your goal has been served. Duration is the minimum time period for which the visitors shall remain on the site to assume that the goal has been served. The Pages/screens per session refer to the minimum number of such pages which would serve the purpose of site. Similarly, triggering an event can itself be a goal.

You shall decide which of these four can define the goal for you. Let us say that reaching the contact us page is something which we would like to set as our destination. This means that the type of goal is ‘destination’. Once it is decided, you shall first describe the title of your goal which shall make it clearly which type of goal you have set. In this case, let this description of title be “contactuspage”. Thereafter, you would be required to enter the page URL or screen name of the page or a regular expression by first defining what the match type is. There are three match types: Equals to, Begins With and Regular Expressions (Check the details of these Match types). Besides providing the URL of the page, you are also required to enter the monetary value, if you would like to assign to this goal and the various funnels which defines the pages from which visitors come here.

Google provides templates of website design where in the goals are predefined and these are categorized as Revenue, Acquisition, Inquiry and Engagement.

Goal Value

While setting up the goals using the Destination type, you are asked to assign a value to the goal. This value is to determine what revenue would be generated when people actually reach this destination. This is most essentially done in the ecommerce websites, where people are expected to spend online and its monetary value can be tracked.

Event Goals

Event goal is one of the types of goals. In order to set this up, you need to set up Event Tracking at first. There are certain types of defined goals such as link on Download which could be a type of goal achieved when a person clicks on it. But, this might be misleading when a person clicks on it for more than once. For this reason, setting up Event tracking is a better alternative. This would require prior configuration of the event tracking code (check out these articles for Classic GA or Universal GA).

Implementation of Goal tracking on third party sites

While implementing the tracking code on your own site is a non-issue and can be done very easily, often a tricky situation is faced when third party tools on your site are being used because you may or may not have the access to their code.

When you do not have the access to their code, you will have to adopt a different strategy. You will need to implement the code at those links where the visitors leave your site. So, this outbound link tracking mechanism is actually a process involving two-steps of execution. First step is to set up an event tracking, such as:

var trackOutboundLink = function(url) {
  ga('send', 'event', 'outbound', 'click', url, {'hitCallback':
    function () {
    document.location = url;

The second step is to add an ‘onclick’ attribute to the outbound link, such as:
<a href="" onclick=”trackOutboundLink(‘’); return false;">Check out</a>
It shall be noted that the event tracking code to be set up in the first step shall be placed in the header section of the page but not within the GA code. You shall make use of expert web development company or developer for this purpose. Before placing the following code in the header section, it is better to define some parameters which are called Event Components. These are Category, Action and Label.

Destination Goals

Destination goals setting might encounter some typical situations. Some of these are discussed below and exhibited are ways and means of doing it in these circumstances, especially the Match Type which needs to be defined in different ways:

a)      Static URLs (which do not involve any special character): In this case the Match Type of ‘Equals To’ works well.
b)      Ecommerce:  If you want to implement the destination goals for ecommerce transactions, there is a need to first implement the ecommerce tracking code to the shopping cart and also add the destination goals. Once that is done, there is no need to enter a value in the Goal Value field and the value of the transactions will appear in the ‘Revenue Metrics’.
c)       Dynamic URLs: If the URLs are dynamic, the correct match types are ‘Begins With’ and ‘Regular Expressions’.  So, if the user visits any page which is dynamic and begins with a particular set of characters which are same across these dynamic pages, then it will be counted as achievement of goal.  
d)      Same URL, many steps:  If there are a number of steps, say Step 1, Step 2 and Step 3 which are opening on the same URL, then it is not recommended to implement the destination goal for the simple reason that there will be one page which will be destination but this page will be same for multiple steps of the process. However, Event Goal and Event tracking is considered a better alternative.

In case funnels are set up for tracking these steps of a particular page URL, then there is a need to alter the GA Classic or GA Universal code, as follows:

Altering GA Classic code:
ga('send', 'pageview', '/funnel_G1/step1.html');
ga('send', 'pageview', '/funnel_G1/step2.html');
ga('send', 'pageview', '/funnel_G1/step3.html');

Altering GA Universal Code:
_gaq.push(['_trackPageview', '/funnel_G1/step1.html']);
_gaq.push(['_trackPageview', '/funnel_G1/step2.html']);
_gaq.push(['_trackPageview', '/funnel_G1/step3.html']);

e)      Goals for multiple criteria: This is a feature of the Goal set up and tracking mechanism provided by Google Analytics, which makes it possible to set the goals for more than one criteria. Using this you would be able to set up goals such as visiting any page in a particular directory or even setting up goal on visiting more than one page of a site.