Welcome Guest, Not a member yet? Register   Sign In
Google Analytics & Codeigniter
#1

[eluser]Unknown[/eluser]
Hello,

I'm having a problem with tracking email newsletters that point at my site because the URL's are re-written to include Google Analytics campaign tracking segments.

For example, this doesn't work....

The '?' character is causing the page to register as a 404.

However, If I add a '/' after the last word, it then works, but this seems unnecessary.

Do I need to force a '/' at the end of all my URL's? Or is there (hopefully) another way around this?

Thanks in advance.
#2

[eluser]Isern Palaus[/eluser]
Yes, the / is necessary unless you use httaccess hacks.

Regards,
-- Isern Palaus
#3

[eluser]Unknown[/eluser]
I have considered this, but really only want to do as a last resort.

Does anyone know where in the core I could allow an exception to recognize the '?'as a traditional query param and disregard anything after?
#4

[eluser]danostuporstar[/eluser]
Crazy thing in my experience (I'm still pretty new to CI) ... htt://example.com/modelname/controllername/some/params?GetArg1=1 *does not* work. It gets a CI 404 page, just like htmiguel reports. BUT htt://example.com/modelname/controllername/some/params?GetArg1=1&GetArg2=2 *does* work. As long as there's more than one (GET) query param, everything is good. Makes no sense to me (and perhaps it has something to do with my mod-rewrite set up, which is not the CI "standard" but is very similar), but whatever, I just add a bogus GET arg at the beginning of the query string and put my real ones at the end. (The query string is used solely by 3rd party apps (e.g. Google analytics), not by the CI application itself.)

htmiguel, have you tested your CI app with multiple GET params?

Anybody else, got any ideas on why one GET param doesn't work for me but multiple ones do?
#5

[eluser]Lone[/eluser]
Have you altered the following setting in your config file:

Code:
$config['permitted_uri_chars']

As far as I can think you just need to add the '?' to it.
#6

[eluser]Spockz[/eluser]
danostuporstar:
Yes: what you say about more than 1 GET params is indeed true. I noticed this on my tour of CI too.
#7

[eluser]Nikhil Vijayan[/eluser]
in application/config/config.php

change it to the following

Code:
$config['uri_protocol']    = "PATH_INFO";


Code:
$config['enable_query_strings'] = TRUE;

Good Luck :coolsmile:
#8

[eluser]supahero[/eluser]
i have solved that problem.
but the problem is when querystring on root uri

example:
http://www.mysite.com?gclid=12345
http://www.mysite.com/?gclid=12345

it'll 404 error

any help ?
#9

[eluser]scubasean[/eluser]
Hi there,

I'm will to pay someone 50 bucks if they can tell me how to solve this problem. I too get 404's with Google adwords on the hompage but not on sub pages...

If you can give me the solution and I have success, I will send you 50 bucks via paypal...

Thanks,

Sean
#10

[eluser]Randy Casburn[/eluser]
[quote author="scubasean" date="1223471656"]Hi there,

I'm will to pay someone 50 bucks if they can tell me how to solve this problem. I too get 404's with Google adwords on the hompage but not on sub pages...

If you can give me the solution and I have success, I will send you 50 bucks via paypal...

Thanks,

Sean[/quote]

@Sean - I like challenges...

Let's see your version of Mod_rewrite, your .htaccess contents (the whole thing) inside code tags, and let us know what your $config['uri_protocol'] is set to, your $config['permitted_uri_chars'], and any routes you have setup in your router.php configuration file.

I bet your problem is answered in these forums some where, but hey...why not.

Randy




Theme © iAndrew 2016 - Forum software by © MyBB