/    Sign up×
Community /Pin to ProfileBookmark

Hello,

I have forwarded domains to my website but to date, no matter what site stats program I used, I can not know which forwarded domain is sending how many visitors (unique if possible) to my website.

Can someone advise me how to write a php code for doing that? This one I need for sure, even if you can’t answer the rest below…

In addition to that, I posted many comments recently, which I cehcked later and were not deleted by moderators. Most of my comments included link to my site. There should definitely have been visitors to my site form those comment links. But so far I saw none…

I also want to know that info too.

Overall, out of about 150 unique visitors a day, I can just see may be 40 of them exactly where they are coming from. The rest is unknown to me…

Please advise about how to write the code. I have intermediate php knowledge.

Thanks

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@welshOct 06.2009 — the only way i could see for you to figure out where they are coming from is if you make them links like:

http://www.yourwebsite.com/?ref=12345678910

and then use [b]$_GET['ref'][/b] to get the [b]12345678910[/b] and then have somewhere that [B]12345678910[/B] is the id for like [B]www.webdeveloper.com[/B]. You could then have a log that information into a tally or something of the likes.

As for seeing if they are unique or not you could have table in a mysql db or a file that lists the date, and there ip address. then when they come to the site check to see if that ip address is logged for that day, if it isnt add the date and there IP. Then to see the number of unique visitors you can just tally up all the IP's for a certain day.

However to my knowledge (which is still limited) there is no way to find out where someone came to your site without there being like something in the url.
Copy linkTweet thisAlerts:
@MindzaiOct 06.2009 — 
However to my knowledge (which is still limited) there is no way to find out where someone came to your site without there being like something in the url.[/QUOTE]


$_SERVER['HTTP_REFFERER'] will usually tell you, and doesn't require the modification of URLs.

For the original problem, it all depends how the domains are forwarded. If it's at the DNS level, then I can't see what you can do about it. If it's at the web server level then that's a different matter.

As far as general stats, you can't go far wrong with Google Analytics. It tells you about as much as you could ever know, and it has a great API for writing your own tools too.
Copy linkTweet thisAlerts:
@ketancoauthorOct 06.2009 — the domains are forwarded such that when you type that domain name, the user is forwarded to my main website. I am not sure what is dns level or web server level... i believe you refer to dns level. i tried google analytics. it doesnt give any info at all about this...
Copy linkTweet thisAlerts:
@MindzaiOct 06.2009 — If the forwarding takes place at the dns level no stats packing will be able to tell you as far as I'm aware. It all happens too early in the request cycle, and often not at all if the DNS server uses a cache (which it will).
×

Success!

Help @ketanco spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...