I have a Codeigniter app and i want to track the search with Google Analytics.
The thing is: GA asks for a parameter and my URL is something like: http://domain.com/search/searchterm.
No query strings, just clean URL’s.
How can i do it ?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Short of changing your CodeIgniter app to only use query strings for the search app, the only way for you to utilize Google Analytics Site Search without changing your URL patterns is to create a new duplicate profile in Google Analytics, and create a filter that turns your URL into one with a query string of the search term.
That involves creating an “advanced” Filter, and doing something like this (Note! This is untested. I recommend doing this on a DUPLICATE profile, so you don’t disturb your central data irrevocably, and tweaking it to ensure it gives you the results you want).
I just implemented this on a site of mine with a similar URL structure, and it seems to be working.
EDIT: Another alternative, which is slightly more obtrusive, is to send a custom pageview value in your Google Analytics snippet on search results pages, to fake a query string in the case of a search term:
Something like (again, this is hack-y):