Question: I want to implement visitors tracking on a php site, to estimate the conversion rates.
What every site tells me is that we should divide the the number of completed transactions to the number of visitos. But to what should we count as 'visitors' I haven't yet found a definite answer.

I may guess, there could be different methods, well let's talk about these that would be more reliable then, and provide for a more accurate calculation.

So, what is that? Should we take a number of let's say unique ips every day, or a number of pages loaded, or what? I'm completely lost, what should we track?

Answer: 
The only really useful metric is "Unique Visitors", specifically unique IPs that don't appear to be bots. The first part is easy but knowing what is and isn't a bot is a complex art. You should really leave this sort of tracking to a dedicated stats package like AWStats or Google Analytics (the later which has tools to track various sorts of goals and conversions).

If you really must have a DIY solution you should definitely start by looking at the browser/bot identification code in AWStats. I imagine that somewhere in there is a humungous list of known browser User Agent strings.

On many sites bots and crawlers can account for over 50% of actual "hits" or "pages" so if you can't identify bots accurately then your stats are basically worthless for most purposes.
There is no universal measure for web statistics. You can only compare against sites with similar measuring methods, and only then as a guide - never a definitive value.

You can measure trends on your own site if you use the same method for measuring from one month to the next for example.

In your case, I think daily unique visitors is the most useful, as it is probably closest to representing the actual number of visitors to a site.