Google Analytics

search engine importer bookmarklet

Drag bookmarklet to your bookmarks toolbar:

GA Import search engine

Instructions:

When the bookmarklet is already added to your toolbar, simply sign in to your Google Analytics account.

Go to Admin and select website you want to manage.

Extend Tracking info option and click Organic Search Sources

Now press GA Import search engine bookmarklet.

In the dialog window paste CSV file contents and click Import.

That's all folks!

Additional resources:

You will need csv file with specified search egines.
You can find example of it here.

Here is full list of search egnines
Simply copy its contents to window created by bookmarklet
Thanks to Maciej Lewiński, real Google guru! :)

Source code:

( function($) {
		var token = window.preload.token.value, findIdRegex = /(?:Settings\/)([a-z0-9]+)(?:\/)/ig, id = findIdRegex.exec(window.location.hash)[1], $overlay = $('<div></div>').css({
			background : 'White',
			width : '100%',
			height : '100%',
			position : 'fixed',
			'z-index' : 999,
			top : '0px',
			opacity : '0.65'
		}).appendTo('#main'), $status = $('<div>no data</div>').css({
			'font-size' : '1.25em',
			'font-weight' : 'bolder',
			padding : '10px 0'
		}), $textarea = $('<textarea placeholder=\'eg. search.com; search_param\'></textarea>').css({
			width : '100%',
			height : '150px'
		}), $okBtn = $('<button class=\'_GAO _GAib _GAxf\'>Import</button>').click(function() {
			var rows = csvJSON($textarea.val());

			$textarea.prop('disabled', true).val('Please wait... It may take few minutes.');
			$okBtn.prop('disabled', true);

			$status.text('initializing!');

			send(0, rows, $status);

		}), $cancelBtn = $('<button class=\'_GAO _GAib\'>Cancel</button>').click(function() {
			$dialog.remove();
			$overlay.remove();
		}), $dialog = $('<div class=\'_GAni _GASd\'></div>').css({
			width : '450px',
			height : '350px',
			position : 'absolute',
			top : '50%',
			left : '50%',
			'margin-top' : '-200px',
			'margin-left' : '-225px',
			'z-index' : 9999
		}).append('<h2 class=\'_GAyl\'>Import search engines:</h2>').append('<div class=\'_GAkh\'><div class=\'_GAFM\'><span class=\'_GAwp\'>Browser list</span><span class=\'_GAo6\'>new line separated</span></div></div>').append($('<div class=\'_GAPI\'></div>').append($textarea)).append($status).append($('<div class=\'_GAGm\'></div>').append($okBtn).append($cancelBtn)).appendTo('#main');

		var send = function(i, r, $c) {
			var value = r[i];

			console.log('Doing row ' + i + ' from ' + r.length + ' rows.');

			if (r.length > i) {
				$c.text((i + 1) + '/' + r.length);

				$.ajax({
				  type: 'POST',
				  url: 'https://analytics.google.com/analytics/web/submitForm?m.page=TrackingOrganicSearchSources&ds=' + id + '&sid=editOrganicSearch&hl=pl&authuser=0',
				  data: {
					token : token,
					domainName : value[0],
					queryParam : value[1],
					editMode : 'CREATE',
					etnityVersion : 1413823458010
					},
				    complete: function(jqXHR) {
				       if(jqXHR.readyState === 4) {
							console.log('success!');
		
							send(++i, r, $c);
				       }   
				    } 
				});
				
			} else {
				location.reload();
			}
		};

		var csvJSON = function(csv) {

			var lines = csv.split('\n');

			var result = [];

			for (var i = 0; i < lines.length; i++) {

				if (lines[i] == '') {
					continue;
				}
				var obj = {};
				var currentline = lines[i].split(';');

				obj[0] = currentline[0];
				obj[1] = currentline[1];
				result.push(obj);

			}

			return result;
		};

	}(jQuery));