472,127 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,127 software developers and data experts.

need to convert google search ref to find what the user search

I work in asp envirments.
i get the ref url that come to my site and i want to convert it to find
out what was the query in (google or other searcher sites)

foe example : if someone goes to google and search some text and my
site was in his resaults and he click on it , in my site i see his link
ref like
http://www.google.co.il/search?hl=iw...1-Google&meta=

i want to know (in asp and save it to DB) what was the word or words
that the user write in search engine.

BR
Yuv

Oct 6 '06 #1
2 1423
You could try passing the string into a URLDecode function and parsing out
the data.

Here's a function found at http://www.thescripts.com/forum/thread52476.html

Function URLDecode(sText)
sDecoded = sText
Set oRegExpr = CreateObject("VBScript.RegExp")
oRegExpr.Pattern = "%[0-9,A-F]{2}"
oRegExpr.Global = True
Set oMatchCollection = oRegExpr.Execute(sText)
For Each oMatch In oMatchCollection
sDecoded = Replace(sDecoded, oMatch.Value, Chr(CInt("&H" &
Right(oMatch.Value, 2))))
Next
URLDecode = sDecoded
End Function

Ray at work

<yu******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
>I work in asp envirments.
i get the ref url that come to my site and i want to convert it to find
out what was the query in (google or other searcher sites)

foe example : if someone goes to google and search some text and my
site was in his resaults and he click on it , in my site i see his link
ref like
http://www.google.co.il/search?hl=iw...1-Google&meta=

i want to know (in asp and save it to DB) what was the word or words
that the user write in search engine.

BR
Yuv

Oct 6 '06 #2
Thanks Ray for your answer ,

but it's not working with the hebrew text (i got some of signs )

do you know how to fix it ?

Yuv

Ray Costanzo [MVP] wrote:
You could try passing the string into a URLDecode function and parsing out
the data.

Here's a function found at http://www.thescripts.com/forum/thread52476.html

Function URLDecode(sText)
sDecoded = sText
Set oRegExpr = CreateObject("VBScript.RegExp")
oRegExpr.Pattern = "%[0-9,A-F]{2}"
oRegExpr.Global = True
Set oMatchCollection = oRegExpr.Execute(sText)
For Each oMatch In oMatchCollection
sDecoded = Replace(sDecoded, oMatch.Value, Chr(CInt("&H" &
Right(oMatch.Value, 2))))
Next
URLDecode = sDecoded
End Function

Ray at work

<yu******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
I work in asp envirments.
i get the ref url that come to my site and i want to convert it to find
out what was the query in (google or other searcher sites)

foe example : if someone goes to google and search some text and my
site was in his resaults and he click on it , in my site i see his link
ref like
http://www.google.co.il/search?hl=iw...1-Google&meta=

i want to know (in asp and save it to DB) what was the word or words
that the user write in search engine.

BR
Yuv
Oct 17 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by fuzzyman | last post: by
8 posts views Thread by Ben Fidge | last post: by
4 posts views Thread by jerm.hannley | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.