ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Google Adwords adds in ?gclid= which kills EE

July 22, 2008 8:07pm

Subscribe [17]
  • #16 / Jul 25, 2008 11:16pm

    Derek Jones

    7561 posts

    Do you have a link that we can look at?  I have a feeling that your rewritten URL is including index.php twice.  You could also check your apache logs to see what full resource is actually being requested on these failed attempts.

  • #17 / Aug 10, 2008 11:08pm

    adhesion

    15 posts

    Was this issue ever resolved?

    I am having exactly the same problem as stated in the above posts, but haven’t found a tidy fix for this yet.

    Any help would be greatly appreciated.

  • #18 / Aug 11, 2008 12:57am

    Derek Jones

    7561 posts

    No, I have not heard from artlab since July 25th above.  As Lisa mentioned, this isn’t something we can provide support for as rewriting URLs is server and not software related, but if you share the full details of your situation (so no one’s making assumptions about similarities between your situation and artlab’s) we might be able to provide some pointers on where to look for further details and/or possible solutions.

  • #19 / Aug 11, 2008 8:21pm

    adhesion

    15 posts

    Problem: Google Adwords Auto Tagging Feature

    <a href="http://www.sitename.com/?gclid=uniqueID">http://www.sitename.com/?gclid=uniqueID</a>

    The tag is passed thru the URL and delivers Adwords metrics into Google Analytics.

    Issue:
    Because of this it can’t resolve the index (homepage) of an Expression Engine website that uses Adwords as Expression Engine reads this and shows a 404 page not found error.

    Reason:
    This happens because of the custom 404 template feature inside EE. When this is turned off everything works fine. I believe it to be caused by the way EE handles {segment_1} within the URL when the feature is turned on.


    This is a crucial feature as Artlab mentions above if we don’t return 404’s in the header we get nailed for duplicate content, URLs get added to search results and build up as EE is passing all URLs as found.

    We also don’t like to “add” extra words to a URL or use any other type of fix as Google reads everything within a URL. Hence having to remove the “index.php” and “template group” from the URL with mod-rewrites.

    We are an SEO/SEM Web Development company and while I understand you don’t support URL rewrites etc we have had to do this to get EE up to speed and reach a “best practice” level of SEO for our customers.

    Website:
    www.whitestudios.co.nz

    Problem:
    Google Adwords link with auto tag included (Google creates this unique link when a user clicks on a Google Adwords Ad
    www.whitestudios.co.nz/?gclid=CLG88f3zhpUCFSQbagodsEYbrA

    Mod Re-writes:

    RewriteEngine On
    RewriteBase /
    
    ErrorDocument 404 /404
    
    #Handle comment redirection
    RewriteCond %{THE_REQUEST} !^POST
    RewriteRule ^site/?(.*)$ /$1 [R=301,L]
    #Handle removal of index.php and template group from EE URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/site/$1 [L]

    Any help that anyone could provide on this issue would be greatly appreciated, as far as I can see within these forums this issue has not be resolved with a “clean fix”.

  • #20 / Aug 12, 2008 12:47pm

    Derek Jones

    7561 posts

    Firstly, I completely disagree with your statement here.

    We also don’t like to “add” extra words to a URL or use any other type of fix as Google reads everything within a URL. Hence having to remove the “index.php” and “template group” from the URL with mod-rewrites.

    We are an SEO/SEM Web Development company and while I understand you don’t support URL rewrites etc we have had to do this to get EE up to speed and reach a “best practice” level of SEO for our customers.

    Removing the index.php is one thing.  Removing the template group?  You’re using EE in a way that goes directly against how it’s designed (you do know that it does not have to be named “site” correct?).  We cannot support that, and if you insist that it’s necessary for SEO, I’m sorry you feel that way; it’s a difference of opinion not worth quarreling over, but you will need to recognize that taking this stand will prevent any staff member from being able to assist you with a number of issues that stem from modifying this behavior.  It’s perfectly fine as far as licensing and your usage is concerned; you’re free to do with the software as you choose in that regard, but we can only support intended use.

    That said, I do appreciate the level of detail in your last response and am interested in making sure that ExpressionEngine is not playing some part in the prevention of this from working.  I’m happy to take you that far - the rest will be up to you and your server admins.

    If you remove the .htaccess entirely, reverting to an out of the box setup, do the links work and provide the information to Analytics as expected?

  • #21 / Aug 12, 2008 7:33pm

    adhesion

    15 posts

    Removing the index.php is one thing.  Removing the template group? 

    If you remove the .htaccess entirely, reverting to an out of the box setup, do the links work and provide the information to Analytics as expected?

    Thanks for your quick response Derek I really appreciate it.

    I completely understand your viewpoint and agree that removing the template group is pushing EE outside the bounds of what it was made to do and definitely not something EE supports.

    If I remove the .htaccess file entirely and revert back to and out of the box EE setup it still doesn’t resolve the homepage, but at that point if I turn off the custom 404 error feature (inside global template prefs), it works fine.

    SEO & URLs
    As you have alluded to in your post above SEO is NOT an exact science and never will be. There are lots of different viewpoints and ideas. What I refer to in my previous post as ‘best practice’ was only meant to refer to Matt Cutt’s views on SEO as he is ‘deemed’ to be some what of an “unauthorised” authority on Google and SEO techniques.

  • #22 / Aug 12, 2008 7:44pm

    Derek Jones

    7561 posts

    Ok, with that information (thanks!) I think the problem is that the query string is already started, so for it to append properly (and not be viewed by the server and consequently EE as an additional URL segment) it would need to use & instead of ? e.g.:

    <a href="http://example.com/&gclid=foo">http://example.com/&gclid=foo</a>

    But that’s not ideal and not under your control.  So I wonder if this wouldn’t do the trick (as a rule preceding your others):

    RewriteCond %{QUERY_STRING} ^(gclid=.*)$ [NC]
    RewriteRule ^(.*)$ index.php?%1 [L]
  • #23 / Aug 12, 2008 8:11pm

    adhesion

    15 posts

    RewriteCond %{QUERY_STRING} ^(gclid=.*)$ [NC]
    RewriteRule ^(.*)$ index.php?%1 [L]

    With that rule added it still doesn’t work but I think your onto something as it does resolve the URL (homepage) when I manually change the “?” to an “&”.

    Just to double check I have this correct in the .htaccess file:

    RewriteEngine On
    RewriteBase /
    
    RewriteCond %{QUERY_STRING} ^(gclid=.*)$ [NC]
    RewriteRule ^(.*)$ index.php?%1 [L]
    
    ErrorDocument 404 /404
    
    RewriteCond %{HTTP_HOST} ^whitestudios.co.nz [NC]
    RewriteRule ^(.*)$ <a href="http://www.whitestudios.co.nz/$1">http://www.whitestudios.co.nz/$1</a> [L,R=301]
    
    #Handle comment redirection
    RewriteCond %{THE_REQUEST} !^POST
    RewriteRule ^site/?(.*)$ /$1 [R=301,L]
    #Handle removal of index.php and template group from EE URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/site/$1 [L]
  • #24 / Aug 12, 2008 8:37pm

    Derek Jones

    7561 posts

    Try the QUERY_STRING rewrite rules with everything else removed, it should be successfully using that as a query string.

  • #25 / Aug 12, 2008 9:47pm

    adhesion

    15 posts

    Try the QUERY_STRING rewrite rules with everything else removed, it should be successfully using that as a query string.

    Just tried that with no luck either - It doesn’t seem to be re-writing the URL to use the “&”.

  • #26 / Aug 12, 2008 11:17pm

    Derek Jones

    7561 posts

    It shouldn’t be rewriting to use & in that example, it’s just making sure that the query string is being passed directly to the index.php without introducing the slash that your primary rewrite does.

    <a href="http://example.com/index.php?gclid=foo">http://example.com/index.php?gclid=foo</a>

    vs.

    <a href="http://example.com/index.php/site/?gclid=foo">http://example.com/index.php/site/?gclid=foo</a>
  • #27 / Aug 13, 2008 7:51pm

    nyeoman

    94 posts

    Why can’t you just do something like this:

    RewriteRule ^\?(gclid=.*)$ /index.php/$1 [R,L]

    I’m also not familiar with mod_rewrite, but at least I’m not 404ing anymore

  • #28 / Aug 13, 2008 8:06pm

    adhesion

    15 posts

    Why can’t you just do something like this:

    RewriteRule ^\?(gclid=.*)$ /index.php/$1 [R,L]

    I’m also not familiar with mod_rewrite, but at least I’m not 404ing anymore

    No luck for me here. Have you had the same issue and fixed it with this Rewrite Rule?

  • #29 / Aug 13, 2008 8:26pm

    nyeoman

    94 posts

    This is one of the things I did to fix my site (it did work). The other…

    On google’s adwords I had my link going to mysite.com (no www) and my ee site is http://www.mysite.com

    so I had to fix everything to go to my site:

    RewriteCond %{HTTP_HOST}   !^www\.mysite.com\.com [NC]
    RewriteCond %{HTTP_HOST}   !^$
    RewriteRule ^/(.*)         <a href="http://www.mysite.com/$1">http://www.mysite.com/$1</a> [L,R]

    the above I did in my vhost file
    then the rewrite rule in my htaccess (mainly cause I’m un-organized)

  • #30 / Aug 13, 2008 11:32pm

    adhesion

    15 posts

    This is one of the things I did to fix my site (it did work). The other…

    On google’s adwords I had my link going to mysite.com (no www) and my ee site is http://www.mysite.com

    so I had to fix everything to go to my site:

    RewriteCond %{HTTP_HOST}   !^www\.mysite.com\.com [NC]
    RewriteCond %{HTTP_HOST}   !^$
    RewriteRule ^/(.*)         <a href="http://www.mysite.com/$1">http://www.mysite.com/$1</a> [L,R]

    the above I did in my vhost file
    then the rewrite rule in my htaccess (mainly cause I’m un-organized)

    ]

    Yeah we have all our websites only resolving to www so no worries there… Still no luck with the above addition. Do you mind posting your .htaccess file so I can see if it’s inline with mine?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases