Google Analytics Tutorial Part 2

by Patrick Altoft on June 12, 2007

The Advanced Google Analytics Tutorial raised more questions than it answered so I have spent this afternoon going through everybody’s comments and trying to answer them.

If you have any more questions please feel free to ask in the comments at the end of this post.

Google has just announced a few new features including the ability (finally) to click on referring url’s and be taken to the referring page.

Michael asked:

Is there a way to see stats based on a specific day? I’d love to be able to see which pages are more popular as I’ve changed my site over time. I might change link position or something for a week and it’d be nice to see stats for that time period only to be able to compare them.

Click on Content > Top Content and then scroll right down to the form that says Find url and type the page you want to view the stats for. In this case I wanted to view stats for users clicking on my outgoing (affiliate) links.

Find url

From the chart below we can see that the link outgoing/top (named because it was at the top of the page) has had 1060 clicks in the time period selected.

The outgoing/top link had 1060 clicks

If you look to the top right of the screen you should see a drop down box containing a data range.

Drop down data range box

Click on the box and enter your desired date ranges in the boxes (hint: click on the box and then the name of the month at the top of the calendar to highlight the whole month) and then click the “Apply Range” button.

Drop down date range box

The result should be a graph comparing data from the two date ranges, one range has a blue line and one is shown with a green line.

Date range box

Hunter asked:

How do we track flash movie plays with google analytics?

Tracking Flash events is the same as tracking JavaScript events, just call the urchinTracker function:

javascript:urchinTracker('/homepage/flashbuttons/button1');

Example Flash Code

on (release) {

// Track with no action

getURL("javascript:urchinTracker('/folder/file');");

}

on (release) _

//Track with action

getURL(“javascript:urchinTracker(‘/folder/file’);”);

_root.gotoAndPlay(3);

myVar = “Flash Track Test”

}
onClipEvent (enterFrame) {

getURL(“javascript:urchinTracker(‘/folder/file’);”);

}

More details

LGR asked:

Is there anyway to attach the onclick event handler on a link I want to track without editing the html, perhaps at the bottom of the page? Just wondering if it is possible to separate the HTML from the javascript so it is easier to maintain.

Motorcycle Guy asked :

Surely there is javascript to add that javascript to every external link? it seems dumb to have to rewrite your whole application.

I don’t think there is an easy way to do this. The best way would be to make your site database driven and append some automatic variables to the events you want to track.

Another solution would be to give each of your links an id parameter and then to track clicks on each id and register the event that way.

If anybody has any better suggestions please post in the comments.

f4rrest commented:

There are some things still only available in the old UI though, such as graphing country-specific visitors.

Clicking on Visitors > Map Overlay and then the Country detail level and finally selecting the graph view I was able to create the chart below. Is this what you were looking for? I suspect you wanted to see how traffic from a certain country changed over time but this isn’t possible unfortunately.

Traffic by country

Slides asked:

Can GA be used to track registered users and their activity on site?

I don’t think GA is the right solution to track individual user sessions and activity on a website. Depending on the data you want to track it sounds like a php application would be best.

darnit commented:

I would love to know how to view the pages sending traffic in the referring information statistics. Not just the domain but a link to the actual page sending traffic.

Clicking on Traffic Sources > Referring Sites and then clicking on del.icio.us (or any of the other sites on the list) you can see a list of the referring pages as well as build a pie chart to visualise the data. Click the “Views” icons to view the pie chart.

Referring pages

This method falls down on sites where the referring page is site.com/page.php?id=12345 as Google strips the id parameter off. It works fine for most blogs as they tend to use a folder structure rather than dynamic urls.

Any more questions feel free to ask below. Big Grin

Patrick Altoft is Director of Search at Leeds based digital & SEO agency Branded3. Patrick also runs Blogstorm.

You can get our blog posts delivered for free by email every day - simply add your email address to the box below or alternatively grab the RSS feed.

Read some similar posts

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

{ 10 comments… read them below or add one }

Stephen Mudra 13 Jun 2007 at 4:25 am

Thanks for the analytics information,

I found using the javascript function

_uacct = false;
function eurl( code ) {
if( _uacct ) {
urchinTracker
(\’/outgoing/\’+code)
}
}

then adding
onclick=\”eurl(\’outgoingsitename\’)\” a cleaner option. It also allowed the analytics code to remain at the bottom of the page, so page load time should remain unaffected.

Matt Keegan 14 Jun 2007 at 7:01 am

I am just now sinking my teeth into the new version of Google Analytics. I like its ease of use and having access to vital statistics with just a couple of clicks of my mouse.

Matt Jones 15 Jun 2007 at 12:50 am

Could you go into the e-mail tracking feature?? I know about the URL maker but how do you set goals for these campaigns and view results.

That would be very useful, thanks

steveg 15 Jun 2007 at 1:17 am

>MotorcycleGuy wanted to automatically add javascript to out going links.
This could be done using a HttpFilter in ASP.Net reasonably easily (see http://www.aspnetresources.com/tools/pipeline.aspx). Not sure about any other platform.

>Slides wanted to track Registered users.
Yes, this is doable, but would require a bit of fiddling around (eg you\’ll have to read the Google Analytics Help and work out the nitty gritty). I’d try something like this:

First create a new Profile called “Registered Users”

Second alter your pages so Registered users have pages containing Javascript that outputs custom Campaign variables (see Google Analytics Help http://www.google.com/support/googleanalytics/bin/topic.py?topic=10996 How Do I Tag My Links and Tool: URL Builder). For instance you might set Campaign Source to “Registered” and Campaign Medium to “Web”

Next create a Custom Filter that Includes everything with a Campaign Source of “Registered”. Apply the filter to Only your Registered profile.

(I’d also create an Unregistered Profile with an Exclude filter. Giving you 3 Profiles “All”, “Registered”, “Unregistered”)

And that should do it.

Another alternative to the campaign tracking stuff would be if your registered users have something in the URL you can create a filter on: http://www.site.com?Registered=true

Andrew 20 Jun 2007 at 9:40 am

Can anyone point me to clearly written instructions for how to get GA to track transactions through a third-party shopping cart? I have seen Google’s instructions at http://www.google.com/support/
analytics/bin/answer.py?answer=26915&topic=7178 but they are not detailed enough to help me with our third-party cart, http://www.securenetshop.com. We transmit product and purchase information to the cart from our pages using a form that is sent when the customer clicks on the “Add to Cart” button and I have already added Google’s code,

just above the urchinTracker code on all our pages, but GA still is not reporting any shopping cart data.
Max Cordy 26 Apr 2008 at 12:28 am

LGR ASKED: Is there anyway to attach the onclick event handler on a link I want to track without editing the html, perhaps at the bottom of the page? Just wondering if it is possible to separate the HTML from the javascript so it is easier to maintain.

ANSWER: The easiest way to do this is through DOM scripting. You can easily traverse the DOM and add an onClick event to each link. It would take about 3 lines of Javascript that would run when the page finishes loading.

Malcolm Sequeira 25 Sep 2008 at 4:54 pm

In response to LGR and Motorcycle Guy:

You can use something like this to traverse the current page and add a tracking function to the onClick event of your links. I have a different version of this running on my site.

http://www.mortenbock.dk/google-analytics-outgoing-links-50.htm

svox 06 May 2009 at 11:15 am

Hi,
You blog has absolutley great tips, thanks for the work.
Getting down to the question – I tried to find out a geographical overlay of visitors coming from the particular reffering site but have not found such a filter. So it’s like having a new source of descent traffic I am couruios what sort of countries it supplies the visitors from. Would appreciate if you’ let me know if it’s feasible to get.

Julia 09 Aug 2009 at 2:31 pm
Find me on Twitter

Patrick,

Your tutorial is the best online resource about GA, including the help section of GA itself. Thank you so much for keeping it updated.

I’d like to know whether GA can be used on intranet portals, and whether there are any constrains.

Thanks in advance!

More comments from Julia
Julia 02 Dec 2009 at 7:56 pm

Very nice article, thank you! I enjoyed it months ago when you just published it, and I enjoyed it now again. I would really be happy if you found time and wrote an article about advanced segments.

{ 2 trackbacks }

75 Ultimate Google Analytics — Tools, Tips & Tricks Resource
11.27.09 at 7:19 pm
How to Getting the most out of Google Analytics — Quick Function
12.11.09 at 7:25 am

Leave a Comment (registration is optional)

Registration is free, takes about 5 seconds and is worth doing.

You can use these HTML tags and attributes:
<a href=""> <b> <blockquote> <code> <em> <i> <strike> <strong>