Greasy Fork is available in English.

Discussions » Creation Requests

Clean Google Custom Search tracking.

§
Posted: 11-04-2015

Clean Google Custom Search tracking.

This is example of Google Custom search

http://behindmlm.com/search-results/?cx=partner-pub-1989076782517459:6677894630&cof=FORID:10&ie=UTF-8&q=Francisco&sa=Search

When you click on one of the results, it adds
&sa=U&ei=KYspVcD8ELDPsQSJkYDABA&ved=0CAoQFjADODI&client=internal-uds-cse&usg=AFQjCNE32LCS5THMP-QdlM--0iz36gFsVw

type of string at the end. Now result page opened in new tab(my settings) reports as not found and bunch of tracking is added. So by preventing Google from adding this string, we would prevent tracking and improve navigation.

Is there a way to remove it on all Google Custom Search pages, not just on this website?

wOxxOmMod
§
Posted: 11-04-2015

This works:

  1. Install Direct Google userscript
  2. Edit its code in your userscript manager (Greasemonkey)
  3. Add // @include /^http.+?&cof=.+?&q=.+?&sa=Search.*/ on a new line after the existing @include line
  4. Save, reload the page(s)

This trick might work with other userscripts (search for google direct or google track).

P.S. @zanetu, do you think this is worth including in your code?

§
Posted: 11-04-2015

Excellent. I hope it get included in next version of Direct Google and not get forgotten.

§
Posted: 12-04-2015

P.S. @zanetu, do you think this is worth including in your code?

I'm afraid not. Google custom search can be embedded in pages of any url pattern (e.g. http://jsfiddle.net/gh/gist/library/pure/6130833/) .

I suggest users add url manually in greasemonkey (or any other userscript manager):

firefox -> about:addons -> user scripts -> direct google -> preferences -> user settings -> included pages -> add...

Since "Direct Google" is not intended to work on non-google websites, however, adding non-google urls might be a bit risky (e.g. breaking existing page functions) .

For those who wish to stay on the safe side, delete Line 45, Line 46 and Line 51 through Line 104, so that existing page functions wouldn't be broken.

§
Posted: 12-04-2015
Edited: 12-04-2015

Is it possible to create separate Google Direct Custom and put most common patters in it? This pattern &client=internal-uds-cse&usg= seems to repeat. How to make include pattern out of it?

Also, I deleted lines you suggested and Direct Google does not work anymore on http://behindmlm.com/search-results/?cx=partner-pub-1989076782517459:6677894630&cof=FORID:10&ie=UTF-8&q=Francisco&sa=Search

wOxxOmMod
§
Posted: 12-04-2015
  1. // @include http*&client=internal-uds-cse* might work
  2. you don't have to delete those lines if the sites you use don't break
§
Posted: 13-04-2015
Edited: 13-04-2015

@boris

That deletion works for me, both on firefox v31.6.0 and chrome v41.0.2272.118. Make sure you delete the correct lines. (Did you see any console error, which is usually highlighted in red, after pressing CTRL+SHIFT+J in firefox? ) Note that only four lines remain in modifyGoogle() after deletion, i.e.

function modifyGoogle() {
    //remove custom search redirects
    $('.gsc-results a[href][data-cturl]').each(function() {
        blockListeners(this, 'mousedown')
    })
}

After deletion of aformentioned lines, the userscript essentially turns into what you call "Google Direct Custom", except for userscript metadata (e.g. @ include, @ name, etc).

Don't forget to add an @ include matching "http://behindmlm.com/search-results/?cx=partner-pub-1989076782517459:6677894630&cof=FORID:10&ie=UTF-8&q=Francisco&sa=Search", as wOxxOm has suggested. Alternatively, if you care little about performance, use // @include /^https?\:\/\// to make the userscript globally functional.

Post reply

Sign in to post a reply.