Forked from emaxerrno/shinji_javascript_tag_urls.js
Last active
August 29, 2015 13:55
-
-
Save yieldmo/8700590 to your computer and use it in GitHub Desktop.
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
| // this could be minified by their build system | |
| // | |
| (function(window,document){ | |
| var tokenizer = function(key, searchString) { | |
| var result = new RegExp(key + "=([^&]*)", "i").exec(searchString || window.location.search); | |
| return result && unescape(result[1]) || ""; | |
| }; | |
| var clickId = tokenizer('click_id'); | |
| if(!clickId || clickId.length < 1){ | |
| return; | |
| } | |
| [].forEach.call(document.getElementsByClassName('ym_tag_with_click'),function(element){ | |
| // this is only for this advertiser | |
| var input = element.getAttribute('value'); | |
| if(input && input.indexOf('click_id') === -1) { | |
| element.setAttribute('value', input + '?click_id=' + clickId); | |
| } | |
| }); | |
| })(window,document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment