Mobile app version of vmapp.org
Login or Join
Pierce454

: How does Google's Website Optimizer do all its funky goodness with an unbalanced tag? Last week one of the guy's at our office did a talk on using Google's Website Optimizer for AB multivariate

@Pierce454

Posted in: #GoogleWebsiteOptimizer

Last week one of the guy's at our office did a talk on using Google's Website Optimizer for AB multivariate testing. In the talk, he says that when you set it up you just add some special code to the page around the HTML you want to vary [ see #3 under multivariate test here ]

<script>utmx_section("Headline")</script>
Welcome!
</noscript>


What's going on with that unbalanced tag at the end? What magic is Google doing?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Pierce454

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sims2060225

The utmx_section("Headline") command will execute as the document is parsed. If it emits a <noscript> tag using document.write() the browser will ignore that particular section, until it meets the </noscript> tag.

Here is the same trick, but with a h1:

<html>
<head><title>Spike</title></head>
<body>
<script>document.write('<h1>');</script>
Header
</h1>
<p>That's how...</p>
</html>


this will give a body looking like

<h1>Header</h1>
<p>That's how...</p>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme