Roundcube Community Forum

Recycle Bin => Recycle Bin => Topic started by: Octavius on April 11, 2007, 02:49:07 AM

Title: Google Analytics on RoundCube
Post by: Octavius on April 11, 2007, 02:49:07 AM
Hello, I would like to put the javascript code of Google Analytics on the homepage of my RoundCube Webmail.

I tried to edit the index.php file but after the insert of the script, the first page is blank..

Could you please tell me where to put the google script?

Title: Re: Google Analytics on RoundCube
Post by: drm on April 11, 2007, 07:23:43 PM
I'm not intimately familiar with Google Analytics..But you certainly don't want to put it in the php files.

Try here: skins/default/includes/header.html

See if that works for you.

-drm
Title: Re: Google Analytics on RoundCube
Post by: Octavius on April 12, 2007, 05:13:39 AM
Hi drm, many thanks for your help.

I tried to put the script into header.html but it's not working. Maybe I have to create another file and include it somewhere ?

Thanks you,

Octavius
Title: Re: Google Analytics on RoundCube
Post by: drm on April 12, 2007, 11:09:55 AM
One thing I notice is - when you add content to that particular file, it is only included once the user is logged in.

So, be sure you're testing that far into the system - and not just the login page.


This is also assuming Google Analytics can be placed anywhere in the web page source (ie - Not in the section like is required by some javascript)

If the code is required to be in the tag, you'll have to add it to all the individual files here:

skins/default/templates/


Hope this helps.
Title: Re: Google Analytics on RoundCube
Post by: Octavius on April 13, 2007, 07:41:21 AM
Hi drm,
I tried the following solutions :

- add an include or requirce_once into the index.php -> result = blank page
- add a link to a .JS script into the main.inc -> result = blank page
- add the code directly on header.html -> normal access but code not recognized by Google Analytics

My conclusion is : when the script of Google Analytics is recognized by Google, the webmail is a blank page ...

I'm desperate :o)

Many thanks for your help,

Octavius.
Title: Re: Google Analytics on RoundCube
Post by: drm on April 13, 2007, 11:23:22 AM
Octavius,

Please copy and paste the header.html file with your google analytics code placed into a message here so I can take a look.

Title: Re: Google Analytics on RoundCube
Post by: Octavius on April 17, 2007, 02:45:16 AM
Hello drm, many thanks. Here is the complete code of header.html :





echo ''
echo ''
?>


Many thanks in advance,
Octavius.
Title: Re: Google Analytics on RoundCube
Post by: drm on April 17, 2007, 07:40:41 AM
Instead of what you pasted, try using this:







Title: Re: Google Analytics on RoundCube
Post by: Octavius on April 18, 2007, 02:15:38 AM
Good morning drm,

I tried too but it's not working, everytime the script is detected by google, round cube is a blank page :(
Title: Re: Google Analytics on RoundCube
Post by: drm on April 18, 2007, 09:37:27 AM
Octavius,

Not sure what to tell ya buddy. You may want to check your error logs to find out why a blank page is being produced.

The code snippet I gave you, I just implemented into my skins/default/includes/header.html file..Logged in..and it worked fine. No issues with it at all.

Good luck!
Title: Re: Google Analytics on RoundCube
Post by: Octavius on April 18, 2007, 10:41:21 AM
Hi again drm,

Ok, now the script is into the code of the page after the login screen. The problem is : Google is not able to detect the script into the webmail pages.

How to put it on the first page ?

Many thanks.
Title: Re: Google Analytics on RoundCube
Post by: drm on April 18, 2007, 10:47:19 AM
Place the following into skins/default/templates/login.html - I would place it right above the tag:



Title: Re: Google Analytics on RoundCube
Post by: Octavius on April 23, 2007, 04:26:39 AM
Yes drm, it works... Many many thanks for your precious help.

Octavius.