Solved

Parsing Search Engine Keywords From Referral URL

Posted on 2004-08-25
3
391 Views
Last Modified: 2012-05-05
Hello,

Does anyone know of any ASP.NET specific information on parsing the key terms from a referral URL for all the major search engines? Trying to display targeted ads dynamically based on the referral URL and am having difficulty finding resources on the subject that aren't years old and written in PHP or Perl.

Thanks
0
Comment
Question by:mskibbz
3 Comments
 
LVL 17

Accepted Solution

by:
AerosSaga earned 500 total points
ID: 11891327
Just find the characters used to delimit the keywords and write a little parsing routine, you can use the php or pearl ones as examples or to find the delimitation characters.  Heres a little example of how to parse for delimited character pattern:

HttpContext.Current.User = New GenericPrincipal(User.Identity, Split(authTicket.UserData, ","))

This splits comma seperated values, you should easily be able to adapt this and use something like this for additional referrer information.

Response.Write("<TABLE><pre>")
If Not Request.UrlReferrer Is Nothing Then
   Response.Write("<TR><TD>Referer</td><td>" & Request.UrlReferrer.ToString() & "</td></tr><pre>")
Else
   Response.Write("<TR><TD>Referer</td><td>blind (no referer)</td></tr><pre>")
End If

Response.Write("<TR><TD>User Agent</td><td>" & Request.UserAgent() & "</td></tr><pre>")
Response.Write("<TR><TD>Host Address</td><td>" & Request.UserHostAddress.ToString & "</td></tr><pre>")
Response.Write("<TR><TD>Host Name</td><td>" & Request.UserHostName & "</td></tr><pre>")
Response.Write("</TABLE>")

Regards,

Aeros
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question