google

Geolocation of your users based on IP address (how to)

Have you ever needed to find out where a site visitor physically was for something beyond analytics? I'm talking about things like finding your user on a map or locations of Store X within 50 miles of the user’s current location. Well, I have, and I've found there's not really one solution that fits all users. Sometimes I find myself having to mix methods to provide the best overall user experience and/or changing up my execution depending on my needs.

For the most part you can break it down to three questions:

Step by Step guilde to installing the Drupal module Google Analytics

The Google Analytics module for Drupal does exactly what you would expect... it lets you add the Analytics code to your site without having to get dirty in any code!

In addition to standard Google Analytics tracking this module lets you track users by profile fields & file downloads which can be really powerful.

 

The steps to get Google Analytics working are simple:

Googlebot, XML and XSLT

My proof of concept pages finally got indexed by google but they only show the xml results in the description, not the rendered HTML (from the XSLT).
It turns out google may report it's self as a mozilla browser but they don't apply XSLT translations, they just present the XML in it's data form.
So the moral of the story is always render the html server side if you think the viewer is a bot (if you use code igniter use their user agent library with is_robot())

By Andrew M Riley on

Stalk me!

Drupal Association Member