View Single Post
  #1 (permalink)  
Old January 17th, 2010, 06:52 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default Google Analytics code added to notification mail containing a full HTML page

Hi there,

Whenever someone posts a code example with a comple HTML page (with body and html tags), the notification e-mail has the following Google analytics code injected:

<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-789257-32");
pageTracker._initData();
pageTracker._trackPageview();
//-->
</script>

At first I thought users posted this, but it's nowhere to be found in the thread, so it must be added by the mail sending engine. I guess the following shows the problem in the confirmation e-mail:

Code:
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
</head>
<body>
  <h1>Test</h1>
  <p>Below this line you probably get Google analytics code in your e-mail.</p>
</body>
</html>
I guess this is not how it's supposed to be?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!