A common complaint I have heard from clients regarding Google Analytics involves losing one’s data to Google’s chasm-sized storage bins, never to be seen again. Sure, Google does provide a healthy API and a nice array of reporting, but what if you want to use log files to upload web data into a home-grown data warehouse? Also, what if unique analytics are being performed from old tools tying web data to offline metrics gathered from other systems?
As it turns out, Google provides a very simple way for anyone to collect and store his or her own copies of the image requests created using the base tag. Two additional function calls are required within the page tagging to collect these requests.
The following two functions need to be called on the pageTracker object before the _trackPageview() call, as displayed below.
Voila! Every page on your website will now be sending an image request to http://www.domain.com/path/to/image.gif, in addition to the utm.gif image request sent to Google’s servers. Once your excitement simmers down to a slow boil, one decision still remains; how and where will you host the image? The following two options exist with their own set of pros and cons.
1. Host the image on the main web server with all the other web files. In this situation, it should be very simple to request a 1x1 transparent pixel to be added anywhere on the server. The downside to including this method is that the analytics log entries will be intertwined with the rest of the image requests for the server, many times requiring some form of pre-processing before storage or back-end analysis.
2. Host the image on a new, unique web server instance. In this case, additional resources or technical know-how will be required to enable the tracking. However, once hosted properly, the web server instance will log all requests made to the image in their own neat file, removing the necessity for any processing on the logs to parse out the analytics data.
If you have any questions about Stratigent’s approach to Google tagging, or if you have general comments or feedback, please feel free to email me at firstname.lastname@example.org