Ok, I have google ad-conversion tracking code that is in a blank redirect page. The problem is that the response.redirect doesn't let the full html code (tracking code) load before response.redirect redirects the page to a different URL. I tried putting a timer on it for 5 seconds, and although it pauses, it doesn't display the html page. Anybody know of another even I could use to let it finish FULLY loading before redirecting? The code is displayed as follows:
On the page_load even handler:
Response.Write("<script type=""text/javascript"">"
& _
"var gaJsHost = ((""
https:"" == document.location.protocol
) ? ""
https://ssl."" : ""
http://www."");" & _
"document.write(unescape("
"%3Cscript
src='"" + gaJsHost + ""google-analytics.com/ga.
js' type='text/javascript'%3E%
3C/script%
3E""));" & _
"</script>" & _
"<script type=""text/javascript"">"
& _
"var pageTracker = _gat._getTracker(""UA-2994
177-1"");"
& _
"pageTracker._initData();"
& _
"pageTracker._trackPagevie
w();" & _
"</script> ")
Now, in the page_loadcomplete I have:
If Not Request.QueryString("locat
ion") = "" Then
System.Threading.Thread.Sl
eep(5000)
Dim oSQLSELECT As SqlConnection = New SqlConnection("Server=<ip address>;User ID=<user>;Password=<passwo
rd>")
oSQLSELECT.Open()
Dim paramLocation = New SqlParameter("paramLocatio
n", SqlDbType.Int)
paramLocation.value = Request.QueryString("locat
ion")
Dim SELECTcommand As New SqlCommand("SELECT ItemURL, Clicks FROM Items WHERE ItemKey = @paramLocation", oSQLSELECT)
SELECTcommand.Parameters.A
dd(paramLo
cation)
Dim SELECTreader As SqlDataReader = SELECTcommand.ExecuteReade
r()
While (SELECTreader.Read())
Response.Redirect("
http://" & SELECTreader.GetValue(0))
End While
oSQLSELECT.Close()
End If