5

I currently have Google Analytics on my site, and one of it's useful functions is that it gives me a nice breakdown of all the search terms people are using to search my site (my site has it's own custom search engine).

However, I've recently noticed that it seems to treat two identical searches with different case as two different search terms. For example: I have both banana and BANANA listed as two separate search terms, each with their own counts.

As I'm sure you can imagine this can get quite annoying when trying to track what users on my site are searching for...

So is there some way to fix this, or is it a bug?

3 Answers 3

5

You can create a filter. A custom filter allows you to manipulate Google Analytics input data, such as the URL or the query string. You can downcase the incoming URL, in this way the query string will always be lower case and Google Analytics won't duplicate the searched term.

2
  • Simone, can you provide a walkthrough or link specifically for doing it with Site Search? I'd also found the links you provide above, but every reference to them always talks about external search keywords and sometimes even specifically mentions this not working with Site Search. Something to do with the filter being applied before the data is processed by the GA report or similar; I could never quite follow. (I'll try and dig it up again.)
    – Su'
    Oct 3, 2011 at 8:55
  • I believe this is the topic for a new question. However, Site Search is based on a query string parameter you specify in your GA account for that profile. Simply create a new Search & Replace filter clicking Add Filter > Custom filter > Search & Replace > Request URI Oct 3, 2011 at 9:43
3

I recently had to do this and figured out how to convert the Search Terms into all lowercase.

As Simone says, you need to create a custom filter. Note: The order of your filters is very important.

  • Create New Custom Filter (Lowercase Request URI).

    1. Filter Type: Custom
    2. Select "Lowercase"
    3. Filter Field: Request URI
    4. Save
  • Assign the Filter order by clicking the link next to the "Add Filter" button.

  • Make sure your "Lowercase Request URI" filter occurs before your Search Term Filter.

I set up my "Search Term Filter" by using Custom > Advanced >

  • Field A -> Extract A (Request URI) [search URI pattern]
  • Output To -> Constructor (Search Term) [$A1]

List of Filter in Order: 1. Lowercase Request URI 2. Search Term Filter

As data is coming into GA, the request URI is going to be lowercased. Then it passes those results to the next filter, which takes in the request URI (now lowercased) and output into a clean search term.

Now someone searching for 'banana' and 'BANANA' will count as one.

I guess in theory, you could instead create a lowercase filter for "Search Term" as your Filter Field, but you would have to place this filter after the "Search Term Filter" because the output of the Search Term Filter is a Search Term (not request URI). I have not tried this though. Basically, you can either lowercase your Request URI first then pass it through the Search Term Filter; or you can filter your Search Terms with all different cases, then pass it through a filter to make them all lowercase. Just be careful, whichever you choose, take note of the input/output data and order the lowercase filter accordingly.

Also, it takes a while before the filter actually kicks in (like an hour or so), so you can't see it work immediately. Sometimes the 'verify this filter' link works, sometimes it doesn't. Also, it's not retroactive so it doesn't convert data collected previous to the lowercase filter; only going forward. Took me a while to figure this out and thought I was doing something wrong.

3

An even simpler solution is to just create a personalized filter, select lowercase and then, in filter field select "search term". Simple as that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.