IP Tracking in Google Analytics ~ Everything in Online Marketing - PPC, Adwords, Analytics, Google, Yahoo & More

Monday, August 3, 2009

IP Tracking in Google Analytics

I was facing some issue related to analytics. I had to track the IP address of visitors from one of my client's Website. To find a solution I just posted a question in LinkedIn.

Here is one of the answer I got. Looks interesting...

This solution was given by Tom Griffin
(LinkedIn of Tom)

Justine-

You can setup Google Analytics to include the user's IP address in reports using pageTracker._setVar.

Background:

pageTracker._setVar allows you to segment traffic using a user-defined variable. This information is then reported in Google Analytics under 'User Defined', under the Visitors menu. Usually marketers segment traffic according to user segments, such as logged in visitors versus not logged in. In this case, you want to segment on a much finer level: the user's ip address.

Execution:

Your goal is to write the user's ip address to Google Analytics using SetVar. Your Google Analytics code will look something like this:



You will need to insert some code in the "USER's IP ADDRESS GOES HERE" placeholder which will inject the IP address into pageTracker._setVar. For example, if your server supports PHP, the code would be as follows:

pageTracker._setVar('');

Benefit:

There is a ton of ways you can get IP address information from your visitors - but the benefit of having it in Google Analytics is that you can then cross/filter/segment it along with the rest of your data. For example, you'll be able to drill down on a specific IP address and understand their site behavior, including pageviews, events (if you're using event tracking), etc...

Let me know if you have any questions on the approach :-) And good luck!

TG

1 comment:

Anonymous said...

Thanks for great information you write it very clean. I am very lucky to get this tips from you


SEO Company Milton keynes