Google Analytics Site Search with Custom Search Engine
“Why isn’t my Custom Search Engine working with Site Search?”
Since I had never used Google’s Custom Search Engine before (shame on me), my answer was:
“Gee, I don’t know, let’s look at the instructions.”
But the instructions were nowhere to be found. The truth is, it’s so easy, you just might miss it.
So I took a look. Site Search was turned on. Check. The Custom Search Engine script was on the page. Check. Results are being displayed. Check.
So what was the problem?

I didn’t notice it at first. The results were being hosted on Google.
In order for site search data to be processed by Google Analytics, you need to bring them back to your site. So in your CSE control panel, under Code, make sure you selelct the iframe option and follow the instructions provided (which, as usual, just involves copying and pasting a little bit of JavaScript.)
Now, at this point you might ask “What the heck is an iframe and how do I do it?”
It is just the term that describes the technique used by Google to get their search results inside your page. Don’t be afraid. There isn’t any additional iframe-related implementation that you have to do.
Oh, and make sure that the new page you create for the results is also tagged with your GATC (Google Analytics Tracking Code.)
That’s it. See, I told you it was easy.







March 2nd, 2008 at 10:14 pm
Why is it that Google does not put this in the help information. Thank good ness I found this I have been trying to make this great feature work and it just would not. I can not wait to see the report tomorrow since this will greatly help me refine the site based on user input. Thanks for the post and i am glad to have found it.
April 29th, 2008 at 8:35 am
THANK YOU! I’ve been struggling for days to figure out why Google Analytics wasn’t showing our custom search engine results!
You’re an angel. Now, tell me why this information isn’t on Google’s extensive help pages.
May 13th, 2008 at 8:17 am
I agree with the comments above. The analytics help makes it seem just a little too simple. THis really should be in there, thanks for writing it down!
May 14th, 2008 at 4:16 am
How can I use the overlay and still get the search terms?
May 20th, 2008 at 1:18 pm
I’m not sure what you mean by using the over and still getting the search terms. If you can give an example, or try to explain it differently, maybe I’ll get what you’re asking.
Sorry,
John
June 1st, 2008 at 8:41 pm
I still don’t get this.
I have a search engine that is on my site. It searches different site (excluding my own site). I want to be able to see what my users are searching for.
June 1st, 2008 at 8:42 pm
Also, does your search engine and your analytics need to be under the same google account?
June 2nd, 2008 at 8:13 am