We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19645
    • 23 Posts
    Google AdWords appends the following querystring to a target url: ?sourceid=navclient-ff&ie=UTF-8&rlz=1BxGGGL_nlNLxxx&q=search-phrase&gclid=CMa5rsabablkjlj

    This results in a 404 page, either when I have search friendly urls turned on or not. Modx uses "q=alias" as a querystring variable to set a page alias. Google Adwords uses "q=search-phrase" for setting a search phrase in an URL. In order to overcome this problem, I have replaced all occurences of [’q’] with [’p’] in "index.php", "index-ajax.php" and "/manager/includes/document.parser.class.inc.php)" to have another querystring variable for setting aliases in Modx.

    In .htaccess I replaced:
    RewriteRule ^(.*)l$ index.php?q=$1 [L,QSA]


    with:
    RewriteRule ^(.*)$ index.php?p=$1 [L,QSA]


    For me, this is now working. Google AdWords visitors now land on the correct pages. I don’t have snippets or modules installed that interfere with this. I guess, I don’t need to expect problems, because snippets, plugins and modules will use a document specific variable to request page alias info?
      • 22303 MODX Staff
      • 10,725 Posts
      Interesting, looks like we need to make the GET parameter name configurable. And, as discussed before, add an .htaccess generator to automatically write the .htaccess rules or at least provide them to the admin to paste into their .htaccess file. This would allow deployments to work in more situations where potential conflicts like this might arise.
        • 12652
        • 228 Posts
        Wow. Boy, if this means what I think it means, I wish I would have known this about $100 ago. :’(
          | Identity Developments delivers SEO focused web design and web presence services
          - it's not about websites, it's about your identity. |
          • 22815
          • 1,097 Posts
          Mintsucker, do you have
          "Destination URL Auto-tagging
          Automatically tag my ad destination URLs with additional information useful in analytics reports." on?
            No, I don't know what OpenGeek's saying half the time either.
            MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
            Forum: Where to post threads about add-ons | Forum Rules
            Like MODx? donate (and/or share your resources)
            Like me? See my Amazon wishlist
            MODx "Most Promising CMS" - so appropriate!
            • 22815
            • 1,097 Posts
            Just did some tests and I can’t see where &q=search-phrase gets added. I can get gclid= easy enough, but in short I don’t get 404s when I send AdWords traffic to a MODx site using standard settings. There must be some option that you’ve enabled - if we could find out what that is, we can better warn people about this issue, or possibly find a way to correct this at the Google level.
              No, I don't know what OpenGeek's saying half the time either.
              MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
              Forum: Where to post threads about add-ons | Forum Rules
              Like MODx? donate (and/or share your resources)
              Like me? See my Amazon wishlist
              MODx "Most Promising CMS" - so appropriate!
              • 12652
              • 228 Posts
              I looked over traffic stats in AWstats for the site that I had used AdWords, but it looks okay. I’m not seeing where any 404’s came up and looks like the traffic went to the pages... they were only linked to through AdWords and not indexed by the SEs, so looks like my situation was okay.
                | Identity Developments delivers SEO focused web design and web presence services
                - it's not about websites, it's about your identity. |
                • 19645
                • 23 Posts
                Quote from: PaulGregory at Dec 11, 2006, 07:21 PM

                Mintsucker, do you have
                "Destination URL Auto-tagging
                Automatically tag my ad destination URLs with additional information useful in analytics reports." on?


                Yes, I have Destination URL Auto-tagging turned on. I have Google Analytics and Google AdWords on a different google accounts and I use a client center to manage my accounts. But, I can’t find any settings to have this querystring appended to my urls.
                  • 17544
                  • 86 Posts
                  Will setting $q = $_SERVER[’REQUEST_URI’] help?

                  $_SERVER[’REQUEST_URI’] is quite useful because it store the original request URL instead of the redirected URL.
                    • 22815
                    • 1,097 Posts
                    Mintsucker: The only place I could find where &q= could possibly be set was in the individual links themselves. It seems it is possible to specify a unique URL for each keyword. Possibly the client centre is adding these? If you could look at them in Google AdWords itself to see if the URLs have &q= in them I would be most grateful as we could have a more definite idea of the circumstances in which the workaround is needed.

                    Incidentally, many thanks for bringing up the issue, and for providing a workaround.

                    I thought for a minute there may actually be another way around this at the MODx level; in some languages a querystring &q=one&q=two results in a q with the value of "one, two", and I couldn’t remember how PHP handles it. But it seems that http://modxcms.com/blog.html?q=donate is the equivalent of donate.html - ie the second q overwrites the first.

                    Quote from: Mintsucker at Dec 11, 2006, 05:02 AM

                    I guess, I don’t need to expect problems, because snippets, plugins and modules will use a document specific variable to request page alias info?
                    Yes, but they may use p= for their own purposes (pagination?), which would then clash with your ’p’ - so watch out for that.
                      No, I don't know what OpenGeek's saying half the time either.
                      MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                      Forum: Where to post threads about add-ons | Forum Rules
                      Like MODx? donate (and/or share your resources)
                      Like me? See my Amazon wishlist
                      MODx "Most Promising CMS" - so appropriate!
                      • 19645
                      • 23 Posts
                      I just asked (emailed) Google.nl about the querystring. Normally, they respond within 24h, they say. The last time I emailed them, I got an answer after 14 days with a question to resend my email. >:( I hope they will do better, this time.