The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Straight php include for web traffic stats
Hi there,
I am developing an in house web traffic stats package for use accross our network. This works by including a php file in the header template for each of our sites t0 logs relevant info. We have a few instalations of vbulletin and would like to have some accurate stats for those areas, however I am having problems finding where best to include the tracking script. Currently we have a custon header file defined in a plugin and this is loaded into the default template. The custom header file contains the tracking include directive. The problem here is that accurate stats are not recorded, so in one day we have 3k+ page loads but all from the same IP (i.e. our server) with no referer or user agent information etc. Can anyone advise of the best place to include the tracking script in order to get accurate results? We are using Version 3.6.7 |
#2
|
||||
|
||||
Check IP address and ignore anything from your own server?
|
#3
|
|||
|
|||
Hi thanks for the reply but perhaps I havent made this clear.
The point is that no other IPs (or other info) are logged when the tracking file is included within VB. VB appears to make the call to the script rather than the end user. I need to have this script run before VB takes over. The script logs information for all other pages without issue, it's only the header called by VB that contains almost no tracking data. |
#4
|
||||
|
||||
can you post your code? Are you using a external .php file, if so how are you calling it?
|
#5
|
|||
|
|||
Sure here a general rundown of the tracking script:
PHP Code:
PHP Code:
Rather than return valid data we get our own server IP back and the name of the header file rather than the end user IP and the name of the forum page. |
#6
|
|||
|
|||
Any ideas?
Are there some core scripts that are called by every forum page that I can insert the additional include directive into? |
#7
|
|||
|
|||
yes answered you in the vb.com here 's how to do:
no you must add in your .htaccess this Code:
php_value auto_prepend_file /path/to/your/codetoinclude.php or php_flag auto_prepend_file /path/to/your/codetoinclude.php Or define it in the php.ini directly, this allow to include a php code to ALL server's requests but many shared hosting doesnt allow this. Im trying to find an alternative to this in a thread below if anyone can help me out. |
#8
|
|||
|
|||
Ah many thanks for your reply.
You may find it useful to know that I just overcame the problem by adding the include directive at the top of the "global.php" vbulletin file. I am now getting valid data for all pages accessed. |
#9
|
|||
|
|||
ok thanks for the tip, mine is working so for request like 404 wich are not indexed with vbulletin, but for your thing yeah global.php should be enough thanks
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|