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?
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
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
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.
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.
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.
Hello drm, many thanks. Here is the complete code of header.html :
echo ''
echo ''
?>
Many thanks in advance,
Octavius.
Instead of what you pasted, try using this:
Good morning drm,
I tried too but it's not working, everytime the script is detected by google, round cube is a blank page :(
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!
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.
Place the following into skins/default/templates/login.html - I would place it right above the tag:
Yes drm, it works... Many many thanks for your precious help.
Octavius.