Google 애널리틱스에서는 images.google 도메인에서 가져 오지만 추천 트래픽으로 표시되는 하루에 약 100 회의 방문이 발생합니다. 키워드를 추출하고 Google 이미지 검색 리퍼러가 어떤 모습을 보이는지 유기적 인 소스를 설정하는 맞춤 코드가 있으며 서버 로그에서 실행할 수있는 모든 리퍼러에서 작동합니다.images.google이 추천 트래픽으로 표시
var ref = document.referrer;
if (ref.search(/www.google/) != -1 && 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 && 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 > 1) {
var vars = split[1].split('&');
vals.params = {};
for(var i = 0, len = vars.length; i < 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('&');
}
//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 && !refUrl.params.q) {
var prev = decodeURIComponent(refUrl.params.prev);
if(prev.indexOf('?q=') !== -1 || prev.indexOf('&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]);
이처럼 보이는 referres을 모두 처리합니다 http://images.google.com/?q= 및 http://www.google.com/?imgres=
추천 트래픽이 어디에서 오는가 모르겠어요. 다른 사람이 본 적이 있습니까?
images.google.com에서 추천 트래픽의 추천 경로로 무엇이 보이나요? – Eduardo