Welcome Guest, Not a member yet? Register   Sign In
Preserving Query Strings for Google Analytics
#1

[eluser]davebaskind[/eluser]
Hi everyone,

We've just inherited a CodeIgniter site from a client who's ended the relationship with their current developer, and I'm a little stuck. I've always wanted to try out CodeIgniter and have heard great things about it and the community from a friend who swears by it. I'm hoping I can ask for an advance bit of generosity here to help us get over this big initial hurdle we're facing!

I've read _everything_ I could come across that could relate to this issue - in fact I've spent close to six hours with no luck at all. The problem (there are others that have posted here about it) stems from our client running Adwords campaigns that append a URL parameter (query string) to inbound links, which Analytics (JavaScript) can identify when the page is first loaded.

As reported by others, adding the parameter results in a 404, and the fix is to set:
Code:
$config['uri_protocol'] = "AUTO";
...to...
Code:
$config['uri_protocol'] = "PATH_INFO";
...and...
Code:
$config['enable_query_strings'] = TRUE

Sadly, this doesn't solve the problem and leaves us with all URLs going to /home and apparently stuck in a perpetual loop of loading (the page never stops loading).

I'm asking in desperation if anyone might have some pointers for us. Understand we're new to the forums and don't want to be "that guy" but we are pretty stuck and looking a little silly right now.

I'm going to paste in the entire .htaccess file from the site as it was when we arrived, just in case there might be an issue here:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# localhost/local network setup
#Not a valid filename
RewriteCond %{REQUEST_FILENAME} !-f
# and is (localhost or local ip address)
RewriteCond %{SERVER_NAME} localhost [OR]
  RewriteCond %{SERVER_NAME} 192\.168\.[0-9]+\.[0-9]+ [OR]
  RewriteCond %{SERVER_NAME} server.mentallyfriendly.com
# and is using the www directory
RewriteCond %{REQUEST_URI} ^/([^/]+)/www/(.*)
RewriteRule ^(.*)$ %1/www/index.php/$1 [L]

# mf.net.au dev setup
# Make sure this file doesn't already exist
RewriteCond %{REQUEST_FILENAME} !-f
# and we're in the mf folder
RewriteCond %{DOCUMENT_ROOT} ^/home/mf/public_html$
# and this is a mercurial repository
RewriteCond %{REQUEST_URI} ^/dev/([^/]*)(.*)
#then route to the appropriate index.php with the configuration symlink/index.php
RewriteRule ^(.*)$ /dev/%1/index.php%2 [L]

#campaignhosting.com.au setup
# Make sure this file doesn't already exist
RewriteCond %{REQUEST_FILENAME} !-f
# and we're in the campaign folder
RewriteCond %{DOCUMENT_ROOT} ^/home/campaign/public_html$
# figure out which directory we're supposed to use
RewriteCond %{REQUEST_URI} ^/([^/]+)(.*)
#then route to the appropriate index.php with the configuration symlink/index.php
RewriteRule ^(.*)$ %1/index.php/$1 [L]

#cpanel ~ setup
RewriteCond %{REQUEST_FILENAME} !-f
#if this request begins with a tilda
RewriteCond %{REQUEST_URI} ^/~([^/]*)(.*)$
#slip an index.php in between the tilda directory and the arguments
RewriteRule ^(.*)$ /~%1/index.php/%2 [L]

# if we're still here... then odds are this is a live site..,
# Not a valid filename? Frontend
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

I'll also include links to previous posts that I've scoured and attempted as fixes:

http://ellislab.com/forums/viewthread/155325/
http://ellislab.com/forums/viewthread/156684/
http://ellislab.com/forums/viewthread/154153/
http://ellislab.com/forums/viewthread/108502/
http://ellislab.com/forums/viewthread/166826/
http://ellislab.com/forums/viewthread/170929/
http://ellislab.com/forums/viewthread/179312/
http://ellislab.com/forums/viewthread/81559/

Any thoughts?

Cheers,
Dave
#2

[eluser]davebaskind[/eluser]
Here's an example of the current behaviour (i.e. changes to config *not* implemented and uri_protocol set to AUTO, still.

I visit

http://www.collarts.edu.au/courses/detai...cAodBSgAAw

This loads the home page

http://www.collarts.edu.au/

But it's returned with a 301 - Moved Permanently HTTP Status.
#3

[eluser]Unknown[/eluser]
Any resolve on this? I have the same problem.
#4

[eluser]davebaskind[/eluser]
Jason, I'm afraid the mystery wasn't solved. We ended up migrating to a new host (which we needed to do anyway), and once we'd done that, changing the
Code:
$config[‘uri_protocol’] = “PATH_INFO”
setting seemed to work. It didn't on the original server.




Theme © iAndrew 2016 - Forum software by © MyBB