homepage Welcome to WebmasterWorld Guest from 54.83.133.189
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe to WebmasterWorld

Home / Forums Index / WebmasterWorld / Website Analytics - Tracking and Logging
Forum Library, Charter, Moderators: Receptional & mademetop

Website Analytics - Tracking and Logging Forum

    
Attempt to create my own web stats service
abhishekkaushik




msg:3986535
 9:48 am on Sep 9, 2009 (gmt 0)

Hi,

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">
sc_project=#*$!#*$!;
sc_invisible=1;
sc_partition=44;
sc_security="#*$!#*$!";
</script>

<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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved