You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by dr...@sdf-eu.org on 2007/09/14 13:47:17 UTC

Google Analytics with Lenya

Hi,

I've set up a Google Analytics account ( http://www.google.com/analytics ) 
and added the tracking code just before the </body> tag in page2xhtml.xsl 
. For some reason, Analytics is not detecting the tracking code. The only 
thing I have noticed is that Lenya converts the first script element into 
an empty element.

Has anyone else had this problem and / or know of a workround?

Cheers,

James

--

"Where do you want to SCO today?"

drseuk@sdf-eu.org
SDF-EU Public Access UNIX System - http://sdf-eu.org

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Google Analytics with Lenya

Posted by dr...@sdf-eu.org.
Hi Bhavya,

Yes. I have tried putting a // comment in to prevent Lenya from 
compressing the first script element into an empty one. As the effect's 
not instantaneous, it's a bit difficult to see if it'll work without 
waiting for 24 hours.

Regards,

James

On Fri, 14 Sep 2007, Bhavya Sharma wrote:

> Date: Fri, 14 Sep 2007 18:45:58 +0530
> From: Bhavya Sharma <bh...@gmail.com>
> Reply-To: user@lenya.apache.org
> To: user@lenya.apache.org
> Subject: Re: Google Analytics with Lenya
> 
> i faced the same problem so after each javascript i had to put another
> javascript tag but that should not be empty , it must have at least one
> declaration even if it of no use
>
> On 9/14/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
>>
>> Hi Daniel,
>>
>> Thanks for the quick reply. It seems to be receiving data now as is (but
>> well after the 24 hour wait Google stipulates). Weird. I still can't see
>> any data appearing but I'll leave it another day or so and see if that
>> changes.
>>
>> Regards,
>>
>> James
>>
>> P.S., I've been keeping a detailed log on how to go from a bare metal box
>> to a live web server with Lenya, including the installation and
>> configuration of Ubuntu Server, iptables, ssh, modifications to Lenya etc.
>> (and Google Analytics!).
>>
>> It might form the basis of a "Lenya Book for Dummies" aimed at small
>> institutions who may not have much IT expertise and just want to use Lenya
>> to install / run one web server by following a step by step guide.
>>
>> If anyone's interested in this, please let me know.
>>
>> On Fri, 14 Sep 2007, Daniel Br��ler wrote:
>>
>>> Date: Fri, 14 Sep 2007 14:27:37 +0200
>>> From: "[ISO-8859-1] Daniel Br��ler" <in...@danielbruessler.de>
>>> Reply-To: user@lenya.apache.org
>>> To: user@lenya.apache.org
>>> Subject: Re: Google Analytics with Lenya
>>>
>>> Hello James,
>>>
>>> then you should get a JavaScript-error, because the first script-tag in
>>> your page2xhtml.xsl is the inclusion of the JS-library.
>>>
>>> Just
>>>
>>> <script src="http://www.google-analytics.com/urchin.js"
>>> type="text/javascript">
>>> </script>
>>>
>>> The second script-tag is xml-valid in my case. If it's not in your case
>>> you could wrap it with /*<![CDATA[*/  ... /*]]>*/
>>>
>>> kind regards
>>> Daniel Br��ler
>>>
>>>
>>> drseuk@sdf-eu.org schrieb:
>>>> Hi,
>>>>
>>>> I've set up a Google Analytics account (
>> http://www.google.com/analytics
>>>> ) and added the tracking code just before the </body> tag in
>>>> page2xhtml.xsl . For some reason, Analytics is not detecting the
>>>> tracking code. The only thing I have noticed is that Lenya converts the
>>>> first script element into an empty element.
>>>>
>>>> Has anyone else had this problem and / or know of a workround?
>>>>
>>>> Cheers,
>>>>
>>>> James
>>>>
>>>> --
>>>>
>>>> "Where do you want to SCO today?"
>>>>
>>>> drseuk@sdf-eu.org
>>>> SDF-EU Public Access UNIX System - http://sdf-eu.org
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>>> For additional commands, e-mail: user-help@lenya.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>>> For additional commands, e-mail: user-help@lenya.apache.org
>>>
>>
>> --
>>
>> "Hey Microsoft, where do you want to 'SCO' today?" :-)
>>
>> drseuk@sdf-eu.org
>> SDF-EU Public Access UNIX System - http://sdf-eu.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>> For additional commands, e-mail: user-help@lenya.apache.org
>>
>
>
>
> -- 
> Thanks
>
> Bhavya Sharma
>

--

"Hey Microsoft, where do you want to 'SCO' today?" :-)

drseuk@sdf-eu.org
SDF-EU Public Access UNIX System - http://sdf-eu.org

Re: Google Analytics with Lenya

Posted by Bhavya Sharma <bh...@gmail.com>.
i faced the same problem so after each javascript i had to put another
javascript tag but that should not be empty , it must have at least one
declaration even if it of no use

On 9/14/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
>
> Hi Daniel,
>
> Thanks for the quick reply. It seems to be receiving data now as is (but
> well after the 24 hour wait Google stipulates). Weird. I still can't see
> any data appearing but I'll leave it another day or so and see if that
> changes.
>
> Regards,
>
> James
>
> P.S., I've been keeping a detailed log on how to go from a bare metal box
> to a live web server with Lenya, including the installation and
> configuration of Ubuntu Server, iptables, ssh, modifications to Lenya etc.
> (and Google Analytics!).
>
> It might form the basis of a "Lenya Book for Dummies" aimed at small
> institutions who may not have much IT expertise and just want to use Lenya
> to install / run one web server by following a step by step guide.
>
> If anyone's interested in this, please let me know.
>
> On Fri, 14 Sep 2007, Daniel Brüßler wrote:
>
> > Date: Fri, 14 Sep 2007 14:27:37 +0200
> > From: "[ISO-8859-1] Daniel Brüßler" <in...@danielbruessler.de>
> > Reply-To: user@lenya.apache.org
> > To: user@lenya.apache.org
> > Subject: Re: Google Analytics with Lenya
> >
> > Hello James,
> >
> > then you should get a JavaScript-error, because the first script-tag in
> > your page2xhtml.xsl is the inclusion of the JS-library.
> >
> > Just
> >
> > <script src="http://www.google-analytics.com/urchin.js"
> > type="text/javascript">
> > </script>
> >
> > The second script-tag is xml-valid in my case. If it's not in your case
> > you could wrap it with /*<![CDATA[*/  ... /*]]>*/
> >
> > kind regards
> > Daniel Brüßler
> >
> >
> > drseuk@sdf-eu.org schrieb:
> >> Hi,
> >>
> >> I've set up a Google Analytics account (
> http://www.google.com/analytics
> >> ) and added the tracking code just before the </body> tag in
> >> page2xhtml.xsl . For some reason, Analytics is not detecting the
> >> tracking code. The only thing I have noticed is that Lenya converts the
> >> first script element into an empty element.
> >>
> >> Has anyone else had this problem and / or know of a workround?
> >>
> >> Cheers,
> >>
> >> James
> >>
> >> --
> >>
> >> "Where do you want to SCO today?"
> >>
> >> drseuk@sdf-eu.org
> >> SDF-EU Public Access UNIX System - http://sdf-eu.org
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> >> For additional commands, e-mail: user-help@lenya.apache.org
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> > For additional commands, e-mail: user-help@lenya.apache.org
> >
>
> --
>
> "Hey Microsoft, where do you want to 'SCO' today?" :-)
>
> drseuk@sdf-eu.org
> SDF-EU Public Access UNIX System - http://sdf-eu.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>



-- 
Thanks

Bhavya Sharma

Re: Google Analytics with Lenya

Posted by dr...@sdf-eu.org.
Hi Daniel,

Thanks for the quick reply. It seems to be receiving data now as is (but 
well after the 24 hour wait Google stipulates). Weird. I still can't see 
any data appearing but I'll leave it another day or so and see if that 
changes.

Regards,

James

P.S., I've been keeping a detailed log on how to go from a bare metal box 
to a live web server with Lenya, including the installation and 
configuration of Ubuntu Server, iptables, ssh, modifications to Lenya etc. 
(and Google Analytics!).

It might form the basis of a "Lenya Book for Dummies" aimed at small 
institutions who may not have much IT expertise and just want to use Lenya 
to install / run one web server by following a step by step guide.

If anyone's interested in this, please let me know.

On Fri, 14 Sep 2007, Daniel Brüßler wrote:

> Date: Fri, 14 Sep 2007 14:27:37 +0200
> From: "[ISO-8859-1] Daniel Brüßler" <in...@danielbruessler.de>
> Reply-To: user@lenya.apache.org
> To: user@lenya.apache.org
> Subject: Re: Google Analytics with Lenya
> 
> Hello James,
>
> then you should get a JavaScript-error, because the first script-tag in
> your page2xhtml.xsl is the inclusion of the JS-library.
>
> Just
>
> <script src="http://www.google-analytics.com/urchin.js"
> type="text/javascript">
> </script>
>
> The second script-tag is xml-valid in my case. If it's not in your case
> you could wrap it with /*<![CDATA[*/  ... /*]]>*/
>
> kind regards
> Daniel Brüßler
>
>
> drseuk@sdf-eu.org schrieb:
>> Hi,
>>
>> I've set up a Google Analytics account ( http://www.google.com/analytics
>> ) and added the tracking code just before the </body> tag in
>> page2xhtml.xsl . For some reason, Analytics is not detecting the
>> tracking code. The only thing I have noticed is that Lenya converts the
>> first script element into an empty element.
>>
>> Has anyone else had this problem and / or know of a workround?
>>
>> Cheers,
>>
>> James
>>
>> --
>>
>> "Where do you want to SCO today?"
>>
>> drseuk@sdf-eu.org
>> SDF-EU Public Access UNIX System - http://sdf-eu.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
>> For additional commands, e-mail: user-help@lenya.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
>

--

"Hey Microsoft, where do you want to 'SCO' today?" :-)

drseuk@sdf-eu.org
SDF-EU Public Access UNIX System - http://sdf-eu.org

Re: Google Analytics with Lenya

Posted by Daniel Brüßler <in...@danielbruessler.de>.
Hello James,

then you should get a JavaScript-error, because the first script-tag in
your page2xhtml.xsl is the inclusion of the JS-library.

Just

<script src="http://www.google-analytics.com/urchin.js"
type="text/javascript">
</script>

The second script-tag is xml-valid in my case. If it's not in your case
you could wrap it with /*<![CDATA[*/  ... /*]]>*/

kind regards
Daniel Brüßler


drseuk@sdf-eu.org schrieb:
> Hi,
> 
> I've set up a Google Analytics account ( http://www.google.com/analytics
> ) and added the tracking code just before the </body> tag in
> page2xhtml.xsl . For some reason, Analytics is not detecting the
> tracking code. The only thing I have noticed is that Lenya converts the
> first script element into an empty element.
> 
> Has anyone else had this problem and / or know of a workround?
> 
> Cheers,
> 
> James
> 
> -- 
> 
> "Where do you want to SCO today?"
> 
> drseuk@sdf-eu.org
> SDF-EU Public Access UNIX System - http://sdf-eu.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
> For additional commands, e-mail: user-help@lenya.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org


Re: Google Analytics with Lenya

Posted by so...@apache.org.
Below is the code for Google Analytics that works for me.
1. There is a newline in the urchin "script" element.
2. The urchin script is in the "head" element so links such as
downloads can be tracked.  The scripts must be loaded before the
links.  HEAD is guaranteed to be before any links.
3. We always specify the UDN because Google Analytics does not seem to
work without it and our servers handle both "example.com" and
"www.example.com".
4. Clear your cache so the homepage is generated after making the
change.  Open the homepage and verify the two pieces of code are on
the page.  Wait 20 minutes, then verify that Google Analytics can see
the code.
5. Google Analytics waits overnight before reporting anything.

HTH,
solprovider

<!-- Lenya Page Builder -->
<xsl:template match="cmsbody">
<html>
<head>
<xsl:call-template name="tracking-scripts"/>
</head>
<body>
<!-- CONTENT -->
<xsl:call-template name="tracking-action"/>
</body>
</html>
</xsl:template>

!-- Google Analytics Scripts -->
<xsl:template name="tracking-scripts">
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
</xsl:template>

!-- Google Analytics Page Tracker -->
<xsl:template name="tracking-action">
<script type="text/javascript">
_uacct = "UA-1234567-1";
_udn="example.com";
urchinTracker();
</script>
</xsl:template>


On 9/14/07, drseuk@sdf-eu.org <dr...@sdf-eu.org> wrote:
> I've set up a Google Analytics account ( http://www.google.com/analytics )
> and added the tracking code just before the </body> tag in page2xhtml.xsl
> . For some reason, Analytics is not detecting the tracking code. The only
> thing I have noticed is that Lenya converts the first script element into
> an empty element.
>
> Has anyone else had this problem and / or know of a workround?
> James

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org