phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Adding Google Analytics


 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
old_forum
Board Member



Joined: 07 Feb 2013

Posts: 5



PostPosted: Mon Feb 18, 2013 3:03 am 
Post subject: Adding Google Analytics

Hi,

I've just signed up for Google Analytics and want to add the script so that every forum page gets analysed.
Google advised to do the following:
Code:
Create a PHP file named "analyticstracking.php" with the code and include it on each PHP template page. Then, add the following line to each template page immediately after the opening <body> tag:
<?php include_once("analyticstracking.php") ?>


Please advise which file or files I should add this to, & which folder should I put the analyticstracking.php file in?

Thank you icon_smile.gif
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 414
Location: Québec


flag
PostPosted: Mon Feb 18, 2013 7:17 am 
Post subject: Re: Adding Google Analytics

I guess common.php would be the safest bet since it's supposed to be called by every page. I'd put the include in the /includes directory.
If it really has to come after <body>, that's another story since you can't put a PHP include in a TPL file. I think eXtremeStyles or some other MOD lets you insert PHP though? Someone else might be able to advise.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Mon Feb 18, 2013 9:09 am 
Post subject: Re: Adding Google Analytics

I'd simply place the analytics code directly in the overall_header.tpl, in between javascript tags..
_________________
phpBB2 will never die, I hope!
Back to top
lumpy burgertushie
Board Member



Joined: 19 Nov 2008

Posts: 214


flag
PostPosted: Mon Feb 18, 2013 4:16 pm 
Post subject: Re: Adding Google Analytics

I have not heard of needing to include a php file for this before. doesn't google give you a different option like the javascript code or something?

over at phpbb.com people are always asking where to put the google analyitics code but it is never including a php file, just javascript or a simple link etc.


robert
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 653
Location: Texas


flag
PostPosted: Mon Feb 18, 2013 7:28 pm 
Post subject: Re: Adding Google Analytics

Do you have web stats on your host already in place? To be honest, I don't like Google's analytics because every page requires a call to their server, as opposed to being 100% local. I use Urchin on my web host, which is the product that Google started with in order to make the analytics package. It's local, faster, and private. I'm not giving up my web statistics to a 3rd party like the big G. icon_wink.gif
_________________
phpBBDoctor Blog
Back to top
old_forum
Board Member



Joined: 07 Feb 2013

Posts: 5



PostPosted: Tue Feb 19, 2013 2:27 am 
Post subject: Re: Adding Google Analytics

thanks for your replies. I put an include in the overall_header.tpl and that seems to be working.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Tue Feb 19, 2013 6:35 am 
Post subject: Re: Adding Google Analytics

HI Dave,

What's the price you pay for the Urchin license?

_________________
phpBB2 will never die, I hope!
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 653
Location: Texas


flag
PostPosted: Tue Feb 19, 2013 8:00 pm 
Post subject: Re: Adding Google Analytics

It came with the server, so I don't have a line-item charge for the Urchin software. When I upgraded my server a few years back, they didn't bring Urchin along, but when I asked they were able to get it installed for me.
_________________
phpBBDoctor Blog
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Tue Feb 19, 2013 9:39 pm 
Post subject: Re: Adding Google Analytics

Ah, that sounds OK.

I had a look at the Urchin website and they don't mention the prize, they refer to resellers. Those in turn don´t reveal any prices.

This makes me think it won't be cheap.

But the idea to use an inhouse analytics tool and thus keep your data private is very good.

The good thing GA has is that it is very complete, and free.

_________________
phpBB2 will never die, I hope!
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0081 seconds using 15 queries. (SQL 0.0011 Parse 0.0002 Other 0.0067)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo