Showing posts with label Google Analytics Filters. Show all posts
Showing posts with label Google Analytics Filters. Show all posts

Wednesday, March 19, 2008

Google Analytics: Tips and Tricks - Show Visitor Behavior from Specific Countries

Problem:
We need to see the online behaviors of visitors from USA and Canada using Google Analytics. In other words we need a profile which only has traffic from USA and Canada.

Solution:
  1. Create a profile in Google Analytics in which you would like to capture visits from USA and Canada.
  2. Create a filter that includes visits from USA and Canada only (described below).

  3. Apply the filter to the profile that you would like to show the data in. (The filter is automatically applied to the profile that you use to create the filter).


Creating the filter to include US and Canada Traffic Only
  1. Filter Name: Give a Name to your Filter.

  2. Filter Type: Select “Custom Filter” and select “Include” in the radio button. We are creating a custom filter to include US and Canada Traffic Only.

  3. Filter Field: Select “Visitor Country” as the filter field. Visitor country is populated based on the IP address of the visitors.

  4. Filter Pattern: This is where you enter the country names. The small trick is with the format and finding out what to enter as the country names. In this case where I needed the visitor behavior from US and Canada, I used United States and Canada as the countries and my filter was
    (Canada|United States). () is required to group all the values together and | is used as on OR.
    So what this filter patter is telling is to match either one of the 2 values (Canada and United States) in the Filter Field (Visitor Country).


    Here is the final view


    Now the question is why did I enter United Sates and Not United States of America of USA or US?
    You need to enter what Google Analytics captures the country name as. To find out what you should enter in the country name, go to a profile that does not have any country filters. Go to Visitors --> Map Overlay and scroll down to see the names of the countries. Use the name exactly as it shows in this list.




More Google Analytics Tips.

Comments? Questions?

Saturday, January 26, 2008

Google Analytics: Tips and Tricks - Show Visitor IP Address in a Report

Problem:
A user of web analytics yahoo group asked if there is a way to show visitors IP address in Google Analytics (GA).

Solution:
Visitors IP address is shown in one of the out of the box reports of most of the web analytics tool or can be easily configured by few clicks. That’s not the case with Google Analytics. I had not tried to create this report in Google Analytics but thought this should not be difficult considering Visitor IP was one of the options available in Google Analytics filters. But after few tries (and finally an email from Brian Clifton, head of Web Analytics at Google EMEA, confirmed that Google Analytics does not allow you to show visitor IP in any report. In fact they do not store Visitor IP because it is considered a Personally Identifiable Information (PII) and storing it in GA is against Google's Privacy Policy. If you are interested in knowing what I tried (because I thought that it will work) continue reading else you have your answer:
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).
Figure 1


Figure 2


Figure 3


How to create “Visitor IP” Filter
  1. Click on “Edit” next to the profile for which you want to create the filter for.

  2. Click on “Add Filter” on the next screen

  3. On Next Screen

    1. Choose “Add New Filter for Profile” radio button

    2. Enter a description name for filter in “Filter Name” field e.g. “Show Visitor IP”

    3. Select “Custom” from “Filter Type” drop down

    4. Choose “Advanced” radio button

    5. 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.

    6. Skip the next line “Field B -> Extract B” as you don’t need any other value

    7. 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.

    8. Select “Field A Required” as Yes

    9. Select Field B Required” as No, since there is no Field B

    10. 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).

    11. Select “Case Sensitive” as No

    12. 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.