homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / Website Analytics - Tracking and Logging
Forum Library, Charter, Moderators: DixonJones & mademetop

Website Analytics - Tracking and Logging Forum

Attempt to create my own web stats service

5+ Year Member

Msg#: 3986533 posted 9:48 am on Sep 9, 2009 (gmt 0)


I have taken an endeavor to create my own web traffic counter service, so far my learning were as follows

(1)information like current page, referral url, browser info, and system info can be extracted from client's browser using a java script code.

(2) Now there is one road block after this, called "same origin policy" according to which a a DOM script like JavaScript cannot be executed from if it is loaded from different domain name also if a script is from same domain then it cannot submit information to foreign URL.

(3)To accomplish above task we can use a dummy <img> tag which is pointing to one foreign php file, this file has ability to process the java script variables into database.

I can successfully run my counter under the same domain name but when it comes to different website the script fails to execute, i have followed all above concept.

Then there is one discrepancy from real example of statcounter an example script is here

<!-- Start of StatCounter Code -->
<script type="text/javascript">

<script type="text/javascript" src="http://www.statcounter.com/counter/counter_xhtml.js"></script><noscript><div class="statcounter"><a href="http://www.statcounter.com/" target="_blank"><img class="statcounter" src="http://c45.statcounter.com/#*$!#*$!/0/#*$!#*$!/1/" alt="free hit counter javascript" ></a></div></noscript>
<!-- End of StatCounter Code -->

In this script they are loading the variables from another domain called statcounter.com and then are no variable in img src line i can see which contains the user information.

Please help me to resolve this problem


Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Website Analytics - Tracking and Logging
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved