Posts Tagged ‘google’

Add Live Chat (GTalk/Jabber) To Your Site

Thursday, July 10th, 2008

Let me start off by saying that this has got to be one of the easiest ways to add "Live Chat" functionality to a website. I searched around for a while and I knew that I wanted to tie the live chat to my Google account (GTalk/Jabber), but didn't realize that Google already provides an API for doing this. It's called Chatback and you can create a Chatback Badge in one or more of the following flavors:
ChatBack Options
Either one can be seamlessly integrated into your site using an iFrame or a simple image/link combination. To create your badge code, visit: http://www.google.com/talk/service/badge/New This page will allow you to create and customize one of the various Chatback Badges for your site.

Google Analytics Date Range – Analytics Today

Wednesday, January 9th, 2008

Google Analytic's default date range is one month. As of this writing, there isn't a way to change it. When tracking the visitors of multiple websites, it is often nice to be able to see the activity of the current day. In order to change the date range, you have to use the Flash based calendar on the right hand side of the page. The calendar sends a request back to Google servers to fetch the information for the date range that you chose. Although nice to use, it can be time consuming and tedious.

Analytics Calendar

The other way to request a date range is to pass a date parameter in the URL:

Example:
https: //google.com....dashboard?...&pdr=20080109-20080109

parameter: pdr

value: 20080109-20080109 (YearMonthDay-YearMonthDay)

Greasemonkey is a Firefox Add-on that allows customized JavaScript to be added to any web page that you visit.

I've written a user script called Analytics Today that sets your Analytics date range to the current day instead of the previous month. You can still obviously change the range just as you do now. Please feel free to try it out. I've included it, along with source code, below!

-

Download it here -> AnalyticsToday.user.js - v0.1.3 (10-21-08)

-

Source Code:

// ==UserScript==
// @name          Analytics Today - v0.1.3
// @namespace     blog.dansnetwork.com
// @description   Sets Google Analytic's default date range to today.

// @include       https://www.google.com/analytics/reporting*

// @exclude
// ==/UserScript==

var url = window.location.href;
var urlParam = "&pdr=";

var today = new Date();
var day = today.getDate().toString();
var month = (today.getMonth() + 1).toString();
var year = today.getFullYear().toString();
var todaysRange;

if(day < 10)
day = '0' + day;
if(month < 10)
month = '0' + month;

var todaysRange = year + month + day + '-' + year + month + day;

if(url.indexOf(urlParam) < 0)
window.location.href += '&pdr=' + todaysRange;