2011-01-05 21 views
2

所以我運行HotelsFirst.com,最近看到一堆谷歌圖片搜索流量 http://screensnapr.com/v/Rm1KdJ.png - 問題是我沒有辦法找到人們正在做什麼樣的搜索到我的網站。有很多不同的着陸頁,所以它必須是很多東西。我在http://www.google.com/support/forum/p/Google+Analytics/thread?tid=4f166221a4857871&hl=en上發現了一些看起來很有用的東西,但是我使用的是不同版本的Google Analytics,因此對我無效。我的JavaScript代碼:如何更好地跟蹤Google Analytics中的Google圖片搜索流量? [特別是關鍵字]

<script type="text/javascript"> 
/* <![CDATA[ */ 
    var _gaq = _gaq || []; 
    _gaq.push(['_setAccount', 'UA-19201482-3']); 
    _gaq.push(['_trackPageview']); 
    (function() { 
     var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 
     ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
     var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 
    })(); 
/* ]]> */ 
</script> 

回答

1

沒有測試過(因爲我沒有被鏈接到谷歌圖片副手任何頁面),但你這是怎麼掛的是腳本將被改編到你的片段。

<script type="text/javascript"> 
/* <![CDATA[ */ 
var _gaq = _gaq || []; 
_gaq.push(['_setAccount', 'UA-19201482-3']); 

var ref = document.referrer; 
if (ref.search(/images.google/) != -1 && ref.search(/prev/) != -1) { 
    var regex = new RegExp("images.google.([^\/]+).*&prev=([^&]+)"); 
    var match = regex.exec(ref); 
    _gaq.push(['_clearOrganic']); 
    _gaq.push(['_addOrganic',"images.google."+ match[1],"q"]); 
    _gaq.push(['_setReferrerOverride', "http://images.google." + match[1] + unescape(match[2]) ]); 
} 
_gaq.push(['_trackPageview']); 
(function() { 
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; 
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; 
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); 
})(); 
/* ]]> */ 
</script> 
相關問題