Roundcube Community Forum

 

Google Analytics on RoundCube

Started by Octavius, April 11, 2007, 02:49:07 AM

Previous topic - Next topic

Octavius

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?


drm

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

Octavius

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

drm

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.

Octavius

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.

drm

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.


Octavius

Hello drm, many thanks. Here is the complete code of header.html :





echo ''
echo ''
?>


Many thanks in advance,
Octavius.

drm

Instead of what you pasted, try using this:








Octavius

Good morning drm,

I tried too but it's not working, everytime the script is detected by google, round cube is a blank page :(

drm

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!

Octavius

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.

drm

Place the following into skins/default/templates/login.html - I would place it right above the tag:




Octavius

Yes drm, it works... Many many thanks for your precious help.

Octavius.