Created
February 1, 2025 10:14
-
-
Save thedivtagguy/57f80d5360bdc91ca70c29394dfd3884 to your computer and use it in GitHub Desktop.
Automatically adds udm=14 to google search results
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Google Search UDM Parameter with Override | |
// @namespace http://tampermonkey.net/ | |
// @version 1.1 | |
// @description Automatically adds &udm=14 to Google searches with override options | |
// @author Your name | |
// @match *://www.google.com/* | |
// @match *://google.com/* | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
// Check if it's a search page and doesn't already have udm parameter | |
if (window.location.pathname === '/search') { | |
// Don't redirect if there's a 'noudm' parameter or if it already has udm=14 | |
if (!window.location.href.includes('noudm') && !window.location.href.includes('udm=14')) { | |
const separator = window.location.href.includes('?') ? '&' : '?'; | |
window.location.href = window.location.href + separator + 'udm=14'; | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment