Ubuntu / Linux news and application reviews.

How To Use Google Analytics For A Facebook Fan Page [Free]

Since a lot of bloggers read WebUpd8, we like to occasionally post about web related stuff. Here is a trick which should help a lot of people owning a Facebook fan page (might also work on Wordpress.com, Myspace and so on).

Google Analytics Public Visitors HTML Counter For Any Website With Sharega (Free)

A while back, we covered how to display some Google Analytics stats on your website, using PHP and the Google Analytics API.

But here is a much simple way of doing this, but for visitor stats only: by using Sharega, a web service which will display a visitors counter on your website, no matter the platform you use because it will allow you to simply enter some HTML code as your counter.

To use Sharega, all you have to do is add it's email address to your Google Analytics users, with 'view stats only' account access, then on the Sharega website enter your website url and finally, add a piece of code to your website.

Display Google Analytics Stats On Your Website [Public Stats]

We use GAPI (gapi-google-analytics-php-interface) to display Google Analytics page views and visits to everyone, without requiring a password - it's all done by using the Google Analytics API.

To make some Google Analytics stats public, you need a PHP5 web host but it you don't have one, there are lots of free alternatives out there and you can then embed the stats using in iframe (very easy).

I have modified the example report which comes with GAPI to display the month, year, number of page views, visits and so on, and sort it by year and then month. It basically looks like this:

google analitycs public stats.

You can view a demo right here, on Web Upd8. As you can see, Google Analytics public stats can be easily integrated into Blogger too (I saw lots of requests of using this in Blogger blogs).

Download GAPI + my Google Analytics public stats example


New Google Analytics Beta Tracking Code

If you use Google Analytics, you probably know that Google suggests (and it's best like that) to place the code just before the </body> tag so that the code is executed as the last element of the DOM. But unfortunately, you can't always do that, because if you want to track the clicks, you have to insert the Google Analytics code before the first link you want to track.


To improve the script's performance, Google decided to load it asynchronously:

Set Up Custom Email Alerts In Google Analytics

A new features was introduced a few days ago in Google Analytics, called "Analytics Intelligence", which monitors your website's traffic. Anytime something significant happens, it adds an automatic alert in your Intelligence reports. If your bounce rate suddenly jumps on one of your referrals, Analytics Intelligence creates an alert.

You can view these alerts on the Google Analytics Inteligence submenu:

Google Analytics Inteligence submenu

But here is how to also create email alerts: on you Google Analytics dashboard, on the left side menu, click on "Intelligence" and then select "Daily", "Weekly" or "Monthy". You will then be able to create a custom alert for the period you selected:

analytics custom alert

Google Analytics Now Allows Users to Make Stats Public

photobucketStarting today, Google Analytics they are allowing websites to access the data via an API and publish it to the web or in applications.

From the blog post:

Many users are clamoring for a simpler way to share their Analytics traffic data with their external stakeholders. These stakeholders, such as investors and advertisers, typically use data reported by other services to evaluate the performance of a company. Many times these estimates are significantly different than that from Google Analytics.

One way to share your Analytics data with everyone is to use our recent integration with Google Ad Planner. With this, you can replace Ad Planner traffic estimates with actual data collected by Google Analytics.

Now you can use the Google Analytics Data Export API to create your own integrations to share Google Analytics data with everyone. For example, if you use WordPress blogging software, you can display Google Analytics traffic data directly on your website using the new Analyticator plugin by Sprial Web Consulting.


Wordpress users can download a plugin here.

Transparency is good. This is going to be a popular way to share metrics with advertisers and users.

Google Analytics API is Now Public Beta

photobucketGoogle released the public beta version of the Google Analytics API after running a private beta program with hundreds of developers for about a year.

With the Google Analytics data API, developers can develop client applications that access Google Analytics data and subsequently present it in new, innovative ways. By combining a wide variety of metrics and dimensions, an API-based client application can deliver custom reports, more refined data or new visualizations that in turn provide new ways to analyze the performance of websites and web applications.

There are already some interesting applications that use the API, including a dashboard that integrates data from Google Analytics, a SEO tool that analyzes the keywords used to find the site, a mobile interface for Google Analytics and an AIR application.

"The Data Export API is easy to use and provides read-only access to all your Analytics data. Any data that's available through the standard Analytics web interface is available through the API. The Analytics API is a Google Data API. This is the same API protocol for Google Calendar, Finance and Webmaster Tools," mentions the Analytics blog.

Improved Google Analytics Tracking Script

Alex Russell posted some interesting stuff on his blog regarding the Google Analytics tracking script (ga.js) and how to make it load faster.

Because ga.js script is quite big (9 kb archived and 22 kb unachieved) and also it uses document.write() which is a blocking, synchronous operation WRT page loading. This is tres dumb. Reasonable people should just include ga.js with a <script> tag, but nearly nobody does. Turns out that sane defaults still matter.

He posted an alternative which you can use instead of Google Analytics script:

<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/dojo/1.3/dojo/dojo.xd.js">
</script>
<script type="text/javascript">
dojo.addOnLoad(function(){
setTimeout(function(){
dojo.require("dojox.analytics.Urchin")
dojo.addOnLoad(function(){
var tracker = new dojox.analytics.Urchin({
acct: "UA-XXXXXX-X" // your tracking # here
})
})
}, 100)
})
</script>
Here are screenshots with the load time before and after using dojo tracking code (the one above) for tracking:

photobucket

photobucket

The strategy is to load Dojo from a CDN (since the page wanted it for other things) and wait until after the page has loaded to include ga.js. This delayed loading ensures that the page is responsive before we start doing anything related to tracking. The nested calls to dojo.addOnLoad show how we can wait for one set of modules to finish before kicking off another group, and in this case we also wait until after the page is responsive to load dojox.analytics.Urchin. This module further delays loading of ga.js, meaning that it doesn’t matter how long it takes for things like DNS to resolve and for Google to serve ga.ja since it’s not ever blocking the user.