On Fri, 27 May 2011 22:09:37 +0100, Jason Pollentier <ja...@underdogseattle.com> wrote:

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
missing.

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
"if(i&gt;-1)"

Then apparently Google doesn't allow XHTML. In XHTML if (i &gt; -1) is correct outside CDATA.

If you can't use XHTML, use HTML5 output mode instead.

$phptal->setOutputMode(PHPTAL::HTML5);

2) They do this insane thing with unbalanced tags. To create an
experiment that alters the main page header, for example:
    <script>utmx_section("Headline")</script>
    <h1>Buy This Product!</h1>
    </noscript>
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:

${structure string:&lt;/noscript&gt;}

--
regards, Kornel Lesiński

_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to