Support ⇒ Troubleshootings ⇒ Where to insert Google analytics code ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexTroubleshootings

Where to insert Google analytics code Reply to topic


I'm not sure if this is the right forum to ask but i didn't see another more suitable forum for this question I have.

I've been trying to install 'google analytics' on my dragonfly site to keep track of my visitors but some how google claims that the tracking code is not installed..
I tried to insert it into 'footer.php' and even made a 'block' with this code in it, so far without any luck.

Where should I put the code, is anyone else using google analytics? if so where do I put the code? Confused

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/ MySQL: 5.0.45. DF version: 9.1.2.1


in the footer.php be warned when you upgrade df it will be over written.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Multiple Setups


Add the analytics code to themes/yours/template/header.html, just before the </head> line.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


it works!! thanks guys not worthy

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/ MySQL: 5.0.45. DF version: 9.1.2.1


Even better. Go to your admin panel and go to the footer option. Post it into one of the three Boxes and you don't even need to bother about re updating it after every upgrade because it is stored in your database!

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/2.0.54 (Unix)/5.0.51/5.2.6/DragonflyCMS 9.2.1


I tried on the all your suggestions, also killed my site cache, but is still don't working for me!

Help please!

Sathees

My site: www.sathees-portal.com

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 1.3.39/MySQL 5.0.37/PHP 5.1.6/dragonfly 9.2


Have you given google time to start the tracking. How long has the tracking script been in? and please dont pm staff to look at a thread so you get a reply faster. Doing that will get your ability to pm taken.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Multiple Setups


Yup time is indeed one big factor when it comes to putting these codes. Give it a day or two and tell us if it doesn't work even then.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/2.0.54 (Unix)/5.0.51/5.2.6/DragonflyCMS 9.2.1


Oooohhh.... You were right!!!
It was only a time problem!!!!
Now is all ok...
Thanks!!!

And Excuse me for pm!

Bye
Sathees

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/Apache 1.3.39/MySQL 5.0.37/PHP 5.1.6/dragonfly 9.2


I think this might be an important contribution for anybody else searching this topic. I was also a bit confused and frustrated with with this.

Phoenix said:
just before the </head> line.


Google says:
immediately before the </body> tag.


I tried both and nothing was working, finally I decided to go for CatchImran suggestion since that seemed closest to what Google advised.

That didn't work either until I remembered to delete the header code! If you have it right, it seems to take about 5 or 10 minutes. Note, I think you need to browse to your home page as a normal visitor a few times, but I might be wrong about that.

Like adventure, visit www.irvinescotland.co.uk

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
CentOS Apache_2.0 Mysql_5.0 PHP_5.2 Dragonfly_9.1


I had a look at this and added it to the footer, I checked I had added the same as the rest of you by looking at the source code of you sites.

Everytime I hit a page with firefox my browser froze and out popped this horrible google bar, worse than that google tells me its set properly yet was reporting that not a soul was on my site, this is while I had 27 members and 19 visitors looking around the site, I spent an hour checking and constantly having my browser froze before I dumped the code.

Have a look at my new chat home: www.worldwidechatters.com
Looking for hosting www.caltonhosting.com

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Google do advise before /body but I found that before /header was just fine and suited me, when I was testing, but I also had other code to stop Google looking at my admin areas.

(It was nice to check it out but now I simply refuse to have Google analytics on any site I have - I don't need their stats that much that I am prepared to have that level of intrusion or accept how much it slows my sites down.)

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):


Phoenix wrote
... or accept how much it slows my sites down.)


Yep, since I blocked access to google analytics from my browser, I'm amazed how much faster many, many sites are to display now!

Pro_News CM™ - Content Management for Dragonfly CMS™

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux / 1.3.39 - 2.4.9 / 5.5.42 - 5.6.16 / 5.4.37 - 5.5.11 / 9.4


i tried in the header, in the footer and the footer text that's sotres in the DB (imrams advice) and google STILL tells me that the code isn't installed... HELP... it is now days later

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
delete my accounts you freaks


I used a cheap fix to get it to accept my site prior to upgrading but there's no way to reset the checker without losing old stats, so I went and created a new profile for my main site. Of course this brought on this headache again but...

I found this Google help page and basically followed the second instructions (dynamic PHP), placing the edited coding right before the footer include.
http://www.google.com/support/googleanalytics/bin/static.py?page=troubleshooter.cs&problem=gatsc&selected=a1h2_a1h2t1_

I changed out the $virtual_page = "example_page_name_1"
to $virtual_page = "name=".$pagetitle;

Also added the missing semi-colon to the end of their include code and nested it in an if statement (only displaying the code for non-admins).

However, the results were not instantaneous. I had to wait three to six minutes before if finally recognized the coding.

I will report tomorrow if it's properly tracking, but I welcome improvements on this solution.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux 2.6.25.15/Apache 1.3.41/MySQL 5.0.51a/PHP 5.2.5/Dragonfly 9.2.1

All times are UTC


Jump to: