// ==UserScript== // @name Google udm14 // @namespace http://tampermonkey.net/ // @version 1.0 // @description Add &udm=14 to Google URL if it doesn't already exist // @author niceEli // @match *://www.google.com/* // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Check if the URL already has the udm parameter const url = new URL(window.location.href); if (!url.searchParams.has('udm')) { // If not, add the udm=14 parameter url.searchParams.append('udm', '14'); window.location.replace(url.href); } else if (url.searchParams.get('udm') !== '14') { // If udm parameter exists but is not equal to 14, update it to 14 url.searchParams.set('udm', '14'); window.location.replace(url.href); } })();