A user of web analytics yahoo group asked if there is a way to show visitors IP address in Google Analytics (GA).
Google Analytics does not allow you to see Visitors IP in any report.
What I Tried:
I created a Custom Filter to grab Visitor IP and put it in “User Defined” visitor attribute. “User Defined” attribute is then shown in “User Defined” report (Figure 1 and Figure 2). This attribute can also be used to segment some other reports (Figure 3).
How to create “Visitor IP” Filter
- Click on “Edit” next to the profile for which you want to create the filter for.
- Click on “Add Filter” on the next screen
- On Next Screen
- Choose “Add New Filter for Profile” radio button
- Enter a description name for filter in “Filter Name” field e.g. “Show Visitor IP”
- Select “Custom” from “Filter Type” drop down
- Choose “Advanced” radio button
- Select “Visitor IP” from “Field A -> Extract A” field drop down and enter (.*) in the field next to it. What this is telling GA is to select Visitor IP and extract all of the content into a temporary variable called A.
- Skip the next line “Field B -> Extract B” as you don’t need any other value
- Select “User Defined” from “Output To -> Constructor” and enter $A1 in the next field. What this is telling GA is that take the first value from A (hence $A1) and put it into “User Defined” variable. This will then show up in “User Defined” report.
- Select “Field A Required” as Yes
- Select Field B Required” as No, since there is no Field B
- Select “Override Output Field” to Yes because you want the new value to replace anything that might be there (also note that “User Defined” attribute can have only one value).
- Select “Case Sensitive” as No
- Click “Finish” button (not shown in the screen above)
The above steps create the filter and will be automatically applied to the profile that you created it for.
Since GA allowed me to choose Visitor IP and create a filter my first reaction was that it should work (not knowing that GA does not store IP). I should have got a hint when I did not see any results and went back to edit my filter. The filter screen had wiped out my selection of Visitor IP in field A (see below).
I thought it was a bug but now I think GA was telling me that “It Won’t Work”. Lesson Learned. Remember what Thomas Alva Edison said” I have not failed. I've just found 10,000 ways that won't work.”
So why I am writing about Google Analytics? Well earlier this month, I wrote in my 2008 Web Analytics prediction that
Google Analytics will mature further and start taking customers from other analytics tools like Omniture, WebTrends, Clicktracks etc. The configuration will become little complicated (and hence need for Google Analytics Expertise will grow) and Google will also expose more APIs to allow companies to pull and merge different kinds of data with Web Analytics Data.
Considering, if what I predicted will indeed come true then it is time to start writing about the lessons I learn while configuring Google Analytics and share my experience so that others can learn from my success and mistakes and also share their experiences.
Have you done custom configuration in GA? Would you like to share your custom configurations? How you created them, what worked what did not etc. If yes, please send me an email and become a co-author on this blog. I will be doing a series on Google Analytics configuration and the lessons I have learned.