Note that there are some explanatory texts on larger screens.

plurals
  1. POimages.google appearing as referral traffic
    text
    copied!<p>I see a decent amount of traffic, around 100 visits a day, that comes from an images.google domain but shows as referral traffic rather than organic in Google Analytics. I have some custom code to pull keywords out and set an organic source for a few variations of what Google Image Search referrers look like, and it works for every referrer I can run it against from the server log.</p> <pre><code>var ref = document.referrer; if (ref.search(/www.google/) != -1 &amp;&amp; ref.search(/imgres/) != -1) { var regex = new RegExp("www.google.([^\/]+).*"); var match = regex.exec(ref); ref = 'http://images.google.' + match[1] + '?' + ref.split('?')[1]; _gaq.push(['_setReferrerOverride', ref]); } else if (ref.search(/maps.google/) != -1 &amp;&amp; ref.search(/q=/) == -1) { var regex = new RegExp("maps.google.([^\/]+).*"); var match = regex.exec(ref); ref = 'http://maps.google.' + match[1] + '?q=' + encodeURIComponent('(not provided)'); _gaq.push(['_setReferrerOverride', ref]); } function splitUrl(url) { var vals = {}; var split = url.split('?'); vals.base = split[0]; if(split.length &gt; 1) { var vars = split[1].split('&amp;'); vals.params = {}; for(var i = 0, len = vars.length; i &lt; len; i++) { var valSplit = vars[i].split('=', 2); vals.params[valSplit[0]] = valSplit[1]; } } return vals; } function joinUrl(urlObj) { var vars = []; for(key in urlObj.params) if(urlObj.params.hasOwnProperty(key)) vars.push(key + '=' + urlObj.params[key]); return urlObj.base + '?' + vars.join('&amp;'); } //fix keyword for old google image search if(ref.match(/^http:\/\/images\.google\./) || ref.match(/^http:\/\/images\.google$/)) { var refUrl = splitUrl(ref); if(refUrl.params.prev &amp;&amp; !refUrl.params.q) { var prev = decodeURIComponent(refUrl.params.prev); if(prev.indexOf('?q=') !== -1 || prev.indexOf('&amp;q=') !== -1) { var prevUrl = splitUrl(prev); refUrl.params.q = prevUrl.params.q; if(!refUrl.params.q) refUrl.params.q = encodeURIComponent('(not provided)'); delete prevUrl.params.q; refUrl.params.prev = encodeURIComponent(joinUrl(prevUrl)); } _gaq.push(['_setReferrerOverride', joinUrl(refUrl)]); } else if(!refUrl.params.q) { refUrl.params.q = encodeURIComponent('(not provided)'); _gaq.push(['_setReferrerOverride', joinUrl(refUrl)]); } } _gaq.push(['_addOrganic', 'images.google', 'q']); _gaq.push(['_addOrganic', 'maps.google', 'q', true]); </code></pre> <p>This handles all of the referres that look like: <a href="http://images.google.com/?q=" rel="nofollow">http://images.google.com/?q=</a> and <a href="http://www.google.com/?imgres=" rel="nofollow">http://www.google.com/?imgres=</a></p> <p>I don't know where the referral traffic is coming from. Has anyone else seen this?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload