Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6636621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:12:32+00:00 2026-05-25T23:12:32+00:00

I have a Codeigniter app and i want to track the search with Google

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T23:12:33+00:00Added an answer on May 25, 2026 at 11:12 pm

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

    enter image description here

    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):

    var search = location.pathname.match(/^\/search\/[^$]/) ?  ("/search/" + ((location.search) ? location.search+"&":"?") + "q=" +  location.pathname.split("/")[2].split("?")[0] ): null;
    _gaq.push("_trackPageview", search);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using codeigniter, I have URL like this ( http://localhost/en/home/submit ). My App
I'm working on an app in CodeIgniter, and I want to have admin pages
We have a popular web-app developed using CodeIgniter. Now we want to expose our
I have a CodeIgniter app which has a controller to invoke Capistrano. Like so:
I'm using CodeIgniter (a PHP framework) to build an app, and I have an
I have codeigniter installed at the root directory, and would like to have a
I have a codeigniter webform, I want to input city/state details from the user,
I am developing a website in linux in codeigniter I have the below url
We're building a PHP app based on Good old codeigniter framework and have run
I have an Codeigniter app (using version 2.1.0) that is writing a transaction to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.