Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-21-2012, 01:28 AM   PM User | #1
jmurphy45
New to the CF scene

 
Join Date: Feb 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
jmurphy45 is an unknown quantity at this point
Macintosh JavaScript tracking code

I am trying to make a code that will get various stats from the user when he or she visits my site like :
browser
computer
screen size
ip address
referrer
etc.

This is the code i have so far. I ma stuck on what i should do in the function.
Code:
<html>
        <head>
            
            
        </head>
            <body>
                
                <script type="test/javascript">
                function stats (){
                    var data =
                
                }
                </script>
                
            </body>
</html>
One more question will I need to use php to send it to my email of could javascript do this.
jmurphy45 is offline   Reply With Quote
Old 05-21-2012, 06:43 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,237
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
You can't get the ip address from JS code. Nor can you get the computer (if by that you mean the brand/cpu/etc.).

You can get referrer and user_agent (which tells you the kind of browser) and screen size. Yes, you will need to use PHP to send yourself the email.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Users who have thanked Old Pedant for this post:
jmurphy45 (05-21-2012)
Reply

Bookmarks

Tags
html, javascript, tracking

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:47 AM.


Advertisement
Log in to turn off these ads.