<body><script type="text/javascript"> function setAttributeOnload(object, attribute, val) { if(window.addEventListener) { window.addEventListener('load', function(){ object[attribute] = val; }, false); } else { window.attachEvent('onload', function(){ object[attribute] = val; }); } } </script> <div id="navbar-iframe-container"></div> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> <script type="text/javascript"> gapi.load("gapi.iframes:gapi.iframes.style.bubble", function() { if (gapi.iframes && gapi.iframes.getContext) { gapi.iframes.getContext().openChild({ url: 'https://www.blogger.com/navbar.g?targetBlogID\x3d8211560\x26blogName\x3dTech+Tips,+Tricks+%26+Trivia\x26publishMode\x3dPUBLISH_MODE_BLOGSPOT\x26navbarType\x3dBLUE\x26layoutType\x3dCLASSIC\x26searchRoot\x3dhttps://mvark.blogspot.com/search\x26blogLocale\x3den\x26v\x3d2\x26homepageUrl\x3dhttp://mvark.blogspot.com/\x26vt\x3d601588505461698440', where: document.getElementById("navbar-iframe-container"), id: "navbar-iframe" }); } }); </script>

Tech Tips, Tricks & Trivia

by 'Anil' Radhakrishna
An architect's notes, experiments, discoveries and annotated bookmarks.

Search from over a hundred HOW TO articles, Tips and Tricks

HOW TO find from which search engine and with what search keywords visitors to your website are coming

Knowing what visitors to your website did last summer may not be easy but it is easy to find with a little programming from which search engine they have come and with what search keywords.

If you are looking for help on let's say "xsl recursion" and land on an IBM Developer knowledgebase article through Google, you will notice a hyperlink on the page - "More dW content related to: xsl recursion" that will lead you to its search page showing other relevant pages. The detection & dynamic generation of the hyperlink on the client side is done by a nifty piece of Javascript (which you can view through your browser with the menu option View > Source)

You can also detect this with ASP.NET using the Uri Class properties on the URL Referrer.

Both Google and MSN Search engines use the the query string variable "q" to hold the keywords submitted by the user while Yahoo Search engine uses "p"?! After you have hit the Search button, the Google Search url looks like this - http://www.google.com/search?hl=en&q=JSON+hijacking&btnG=Google+Search

You can find the URL Referrer using the Request.UrlReferrer property ( Uri MyUrl = Request.UrlReferrer; ), the host name (MyUrl.Host) and the querystring (MyUrl.Query). The search keyword information thus extracted can be processed to personalize the page & "cross-sell" other related pages by displaying them as hyperlinks.

Labels: ,

Tweet this | Google+ it | Share on FB

« Home | Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »
| Next »

Posted by Blogger DotNetGuts | 5/25/2007 08:01:00 PM

Hi Anil,

Hey thtz an Interesting post, but i am sure, you are aware of Google Analytics (www.google.com/analytics) than a few line of code appending will do all the analysis, with benefits of All you have mentioned and more and that all FREE., than is it feasible to go with??? Can you please mention few more advantage, so that it can be concluded.

Good work.
DotNetGuts (DNG)

Posted by Blogger Anil | 5/28/2007 12:30:00 PM

Google Analytics is no doubt good for site analysis. However, if you want to customize pages on the fly with links to other interesting content on your website related to the search keywords that the user has submitted then your code would have to know the search keywords at that point of time. So this essentially helps to personalize the page & promote other pages of your website.    


Post a Comment