English 中文(简体)
ASP.NET(webforms)是否与Google网站优化器多变量测试不兼容?
原标题:Is ASP.NET (webforms) Incompatible with Google Website Optimizer Multivariate Testing?

我整个上午都在苦苦挣扎,试图在谷歌网站优化器中进行多元测试。

我已经将页眉/页脚代码复制并粘贴到页面中,并设置了一个基本的页面部分,以确保一切正常。

当我试图验证代码时,它的失败说明

"No sections detected on test page
TestSectionName - Unexpected or missing characters - Line: 422 Expected: </noscript>"

愚蠢的是,输出很清楚(我使用了一个asp文本来绕过asymmetric noscript标记),并且可以在源代码中清楚地看到它,如下所示:

<script>utmx_section("TestSectionName")</script><h1>Buy This Product!</h1></noscript>

我已经尝试过禁用/删除网站中现有的谷歌分析代码,因为这与它有冲突,但运气不佳。

我认为asp.net框架和这个WSO框架可能有些不兼容。我能够使用保存到一个没有asp.net/page内容的原始html文件中的完全相同的代码,并对其进行验证。

例如。

<html><head></head><body>
<!-- Google Website Optimizer Control Script -->
<script>
function utmx_section(){}function utmx(){}
(function(){var k= xxxxx ,d=document,l=d.location,c=d.cookie;function f(n){
if(c){var i=c.indexOf(n+ = );if(i>-1){var j=c.indexOf( ; ,i);return c.substring(i+n.
length+1,j<0?c.length:j)}}}var x=f( __utmx ),xx=f( __utmxx ),h=l.hash;
d.write( <sc + ript src=" +
 http +(l.protocol== https: ? s://ssl : ://www )+ .google-analytics.com 
+ /siteopt.js?v=1&utmxkey= +k+ &utmx= +(x?x:  )+ &utmxx= +(xx?xx:  )+ &utmxtime= 
+new Date().valueOf()+(h? &utmxhash= +escape(h.substr(1)):  )+
 " type="text/javascript" charset="utf-8"></sc + ript> )})();
</script>
<!-- End of Google Website Optimizer Control Script -->

<script>utmx_section("TestSectionName")</script><h1>Buy This Product!</h1></noscript>


<!-- Google Website Optimizer Tracking Script -->
<script type="text/javascript">
if(typeof(_gat)!= object )document.write( <sc + ript src="http +
(document.location.protocol== https: ? s://ssl : ://www )+
 .google-analytics.com/ga.js"></sc + ript> )</script>
<script type="text/javascript">
try {
var gwoTracker=_gat._getTracker("UA-xxxxx-1");
gwoTracker._trackPageview("/xxxxx/test");
}catch(err){}</script>
<!-- End of Google Website Optimizer Tracking Script -->

</body>
</html>

After all of this I am wondering if there is
a) anyone out there using asp.net with multivariate testing successfully
b) a known incompatibility with something in asp.net
c) known "donts" when it comes to coding with WSO multivariate testing
d) something really obvious I am missing?

问题回答

我在ASP.NET网站上使用了Google网站优化器的多变量测试,没有任何问题。

您是否尝试过将</noscript>在自己的行上?我想我总是把它放在默认部分后面的一行空白处。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!