On Fri, 27 May 2011 22:09:37 +0100, Jason Pollentier
I'm trying to get Google Website Optimizer working on my site using
PHPTAL, and I ran into a couple of big problems. I'm hoping somebody
else has already figured this out or can point out some solutions I'm
1) Google wants to verify that their code is installed correctly on my
page before I can continue with the setup. They're very particular, to
the point of complaining about the "// <![CDATA[" I inserted between the
opening <script> tag and the first line of their tracking code. Leaving
out the CDATA causes a complaint when "if(i>-1)" turns into
Then apparently Google doesn't allow XHTML. In XHTML if (i > -1) is
correct outside CDATA.
If you can't use XHTML, use HTML5 output mode instead.
2) They do this insane thing with unbalanced tags. To create an
experiment that alters the main page header, for example:
<h1>Buy This Product!</h1>
and they go so far as to say "Don't worry about the unbalanced
</noscript> tag -- this is part of the setup."
That is crazy (I guess they're inserting <noscript> with document.write. I
feel sorry for browser vendors who have to support such things...)
If you really need to generate such garbage, then this will fly under
PHPTAL's well-formedness radar:
regards, Kornel Lesiński
PHPTAL mailing list