Google Analytics Code into VB.Net String

Please put this Google Analytics script into a VB.Net string. Like this:
  Dim strScript As String = _
                "<script src='http://www.google-analytics.com/urchin.js' type='text/javascript'> </script> " & _
                    "<script type='text/javascript'>_uacct = 'UA-xxxxxxx-1';urchinTracker();</script>"



<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">
try {
var pageTracker = _gat._getTracker("UA-xxxxxxx-1");
pageTracker._trackPageview();
} catch(err) {}</script>

Thank you!
LVL 1
ndonhauserAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CodeCruiserCommented:
Are you struggling with " ?

Try this

Dim strScript As String = "<script type=" & chr(34) & "text/javascript" & chr(34) & ">var gaJsHost = ((" & chr(34) & "https:" & chr(34) & "== document.location.protocol) ? " & chr(34) & "https://ssl." & chr(34) & " : " & chr(34) & "http://www." & chr(34) & ");document.write(unescape(" & chr(34) & "%3Cscript src='" & chr(34) & " + gaJsHost + " & chr(34) & "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E & chr(34) & ""));</script><script type=" & chr(34) & "text/javascript" & chr(34) & ">try {var pageTracker = _gat._getTracker(" & chr(34) & "UA-xxxxxxx-1" & chr(34) & ");pageTracker._trackPageview();} catch(err) {}</script>"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ndonhauserAuthor Commented:
Thank you!

            Dim strScript As String = String.Format( _
                    "<script type={0}text/javascript{0}>var gaJsHost = (({0}https:{0}== document.location.protocol) ? " & _
                    "{0}https://ssl.{0} : {0}http://www.{0});document.write(unescape({0}%3Cscript src='{0} + gaJsHost + " & _
                    "{0}google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E & chr(34) & ""));" & _
                    "</script><script type={0}text/javascript{0}>try {{var pageTracker = _gat._getTracker({0}{1}{0});" & _
                    "pageTracker._trackPageview();}} catch(err) {{}}</script>", Chr(34), strGoogleCode)
0
ndonhauserAuthor Commented:
Thank you
0
CodeCruiserCommented:
Glad to help :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.